program for following output using for loop?
1 2 3 4 5
2 3 4 5
3 4 5
4 5
5

Answer Posted / letskools

I think th correct program is this for the above output
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j;
clrscr();

for(i=0;i<=5;i++)
{
for(j=i;j<=5;j++)
{
printf("%d",j);
}
printf("\n");
}
getch();
}

Is This Answer Correct ?    2 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Define the scope of static variables.

606


what are the facialities provided by you after the selection of the student.

1659


Why does notstrcat(string, "!");Work?

643


Is a house a mass structure?

642


Is it acceptable to declare/define a variable in a c header?

688






please explain clearly about execution of c program in detail,in which stage are the printf sacnf getting into exeecutable code

1706


Explain the use of keyword 'register' with respect to variables.

590


How do you determine a file’s attributes?

602


Why is extern used in c?

612


What is c programming structure?

620


Explain what math functions are available for integers? For floating point?

615


Can static variables be declared in a header file?

618


p*=(++q)++*--p when p=q=1 while(q<=6)

1268


What are terms in math?

594


writ a program to compare using strcmp VIVA and viva with its output.

1525