Q. write a C following number triangle :
1
2 2
3 3 3
4 4 4 4
5 5 5 5 5
Ans.
/*c program for number structure*/
#include<stdio.h>
#include<conio.h>
int main()
{
int num,r,c;
printf("Enter structure number : ");
scanf("%d", &num);
for(r=1; r<=num; r++)
{
for(c=1; c<=r; c++)
printf("%d",r);
printf("\n");
}
return 0;
}
Output:-
Enter structure number : 5
1
2 2
3 3 3
4 4 4 4
5 5 5 5 5
1
2 2
3 3 3
4 4 4 4
5 5 5 5 5
Ans.
/*c program for number structure*/
#include<stdio.h>
#include<conio.h>
int main()
{
int num,r,c;
printf("Enter structure number : ");
scanf("%d", &num);
for(r=1; r<=num; r++)
{
for(c=1; c<=r; c++)
printf("%d",r);
printf("\n");
}
return 0;
}
Output:-
Enter structure number : 5
1
2 2
3 3 3
4 4 4 4
5 5 5 5 5
i needed it so much.. thanks Mr. Dinesh
ReplyDeleteABDUL JUNAID
how about we are using foxpro ?
Deletei am realy happy sir it make me happy
ReplyDeletei am realy happy sir it make me happy
ReplyDeleteMANY MANY THANK TO U
ReplyDeletehow can i progress in programming c sir please tell me the way...............
ReplyDeletetell me how to develop this
ReplyDelete1
1 3
1 3 5
1 3 5 7
1 3 5 7 9
what if we are using foxpro ....
ReplyDeletecan you help how to get
ReplyDelete4
3 4
2 3 4
1 2 3 4
can you help me to get
ReplyDelete4
3 4
2 3 4
1 2 3 4
can you help how to get
ReplyDelete4
3 4
2 3 4
1 2 3 4