print the pattern 1
2 4
3 6 9
4 8 12 16
5 10 15 20 25
if n=5
Answer Posted / akshay chinche
#include<stdio.h>
int main()
{
int i,j,k,n=5,temp=2,fix;
fix=k=1;
for(i=1;i<=4;i++)
{
fix++;
k=fix;
for(j=1;j<=n;j++)
{
if(j<=i+1)
{
printf("%d ",k);
k=k+temp;
}
}
k=0;
temp++;
putchar (10);
}
return 0;
}
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
Is c procedural or object oriented?
List the difference between a 'copy constructor' and a 'assignment operator' in C?
What is the size of structure in c?
How can I write a function that takes a format string and a variable number of arguments?
Differentiate between #include<...> and #include '...'
Can a pointer be static?
What are the advantages of c language?
exit () is used to a) exit () terminates the execution of the program itself b) exit () terminates the execution of the loop c) exit () terminates the execution of the block d) none of the above
How do we print only part of a string in c?
What do you mean by command line argument?
write a program in c language to print your bio-data on the screen by using functions.
What are the loops in c?
What are lookup tables in c?
in any language the sound structure of that language depends on its a) character set, input/output function, its control structures b) character set, library functions, input/output functions its control structures c) character set, library functions, control sturctures d) character set, operators, its control structures
What is sizeof array in c?