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
What is sizeof int in c?
What is meant by recursion?
number of times a digit is present in a number
Write a program to implement a round robin scheduler and calculate the average waiting time.Arrival time, burst time, time quantum, and no. of processes should be the inputs.
What is the difference between array and pointer in c?
Describe newline escape sequence with a sample program?
What is array in c with example?
what is a function method?give example?
What is the purpose of type declarations?
Explain what are multidimensional arrays?
What is enumerated data type in c?
What is property type c?
Hi how many types of software editions are there and their difference (like home editions, enterprise, standard etc) can u please help me
Can include files be nested? How many levels deep can include files be nested?
The number of bytes of storage occupied by short, int and long are a) 2, 2 and 4 b) 2, 4 and 4 c) 4, 4 and 4 d) none