/*Before seeing the code solution make sure that you have tried enough. Don’t copy- paste the whole code. Find out the logic. If you face any trouble, just inform me in comment.*/
#include <stdio.h>
int main()
{
int N, a,b,c=1,d=4;
scanf("%d", &N);
for(a=1;a<=N;a++)
{
for(b=c;b<=d;b++)
{
if(b%4==0)
printf("PUM\n");
else
printf ("%d ",b);
}
c+=4; d+=4;
}
return 0;
}
//Happy_Coding
#include <stdio.h>
int main()
{
int N, a,b,c=1,d=4;
scanf("%d", &N);
for(a=1;a<=N;a++)
{
for(b=c;b<=d;b++)
{
if(b%4==0)
printf("PUM\n");
else
printf ("%d ",b);
}
c+=4; d+=4;
}
return 0;
}
No comments:
Post a Comment