a simple c program using 'for' loop to display the output
5
4
3
2
1
Answer Posted / prayashjeet chanda
#include<stdio.h>
#include<conio.h>
void main()
{
clrscr();
int num,i;
printf("\nEnter a number: ");
scanf("%d",&num);
for(i=num;i>0;i--)
{
printf("\n%d",i);
}
getch();
}
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What is the use of putchar function?
How many bytes is a struct in c?
How many loops are there in c?
What is the difference between void main and main in c?
What is the function of volatile in c language?
How do I get an accurate error status return from system on ms-dos?
what is different between auto and local static? why should we use local static?
What does *p++ do?
What is the use of function in c?
Describe the steps to insert data into a singly linked list.
What is enumerated data type in c?
Explain what are compound statements?
What is the purpose of clrscr () printf () and getch ()?
Create a simple code fragment that will swap the values of two variables num1 and num2.
What does a derived class inherit from a base class a) Only the Public members of the base class b) Only the Protected members of the base class c) Both the Public and the Protected members of the base class d) .c file