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
program to find error in linklist.(i.e find whether any node point wrongly to previous nodes instead of next node)
Why is not a pointer null after calling free?
What could possibly be the problem if a valid function name such as tolower() is being reported by the C compiler as undefined?
void main(int n) { if(n==0) return; main(--n); printf("%d ",n); getch(); } how it work and what will be its output...............it any one know ans plz reply
What are high level languages like C and FORTRAN also known as?
What are volatile variables in c?
Define recursion in c.
Can a variable be both static and volatile in c?
Is exit(status) truly equivalent to returning the same status from main?
Explain what are compound statements?
Can a void pointer point to a function?
How macro execution is faster than function ?
How can you find the day of the week given the date?
What are identifiers and keywords in c?
What is data structure in c programming?