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

Answer Posted / jayaraj.s

#include <stdio.h>
main()
{
int a,b,i=1;
for(a=i;a<=5;a++)
{
for(b=a;b<=5;b++)
{
printf("%d",b);
}
printf("\n");
i++;
}
getch();
}

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why is c called c?

630


What is pragma in c?

629


What is a method in c?

628


Write a program to input the price of 1 burger and the number of burgers eaten by a group of friends .print the total amount to be paid by the group?

580


In c language can we compile a program without main() function?

582






What happens if you free a pointer twice?

610


How can I implement sets or arrays of bits?

607


Does c have enums?

602


Can you subtract pointers from each other? Why would you?

558


How we can insert comments in a c program?

633


Explain what is meant by high-order and low-order bytes?

635


What is gets() function?

673


Which is better pointer or array?

598


what is the differnce between programing langauge and tool? is sas is a programing langauge r tool?

1906


What is meant by initialization and how we initialize a variable?

587