/*write a Program using nested for loop*/
#include<stdio.h>
#include<conio.h>
void main()
{
int r,c,sum;
clrscr();
for (r=1;r<=3;r++)
{
for (c=1;c<=2;c++)
{
sum=r+c;
printf("\nr=%d, c=%d, sum=%d",r,c,sum);
}
}
getch();
}
#include<stdio.h>
#include<conio.h>
void main()
{
int r,c,sum;
clrscr();
for (r=1;r<=3;r++)
{
for (c=1;c<=2;c++)
{
sum=r+c;
printf("\nr=%d, c=%d, sum=%d",r,c,sum);
}
}
getch();
}
Hope you liked my posts, give comments if you have any doubts.. :)
Categories:
c program
1 comments:
program to get a output
&
& &
& &
& & & & &
Post a Comment