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 code for 3 questions and answer check in VisualBasic.Net?
What is clrscr ()?
What is the difference between the local variable and global variable in c?
Is multithreading possible in c?
Is there sort function in c?
What is #include stdio h?
how do you programme Carrier Sense Multiple Access
How can you increase the size of a dynamically allocated array?
What is a const pointer in c?
how to execute a program using if else condition and the output should enter number and the number is odd only...
How is a macro different from a function?
Why clrscr is used in c?
Differentiate between full, complete & perfect binary trees.
Is there a way to have non-constant case labels (i.e. Ranges or arbitrary expressions)?
What are header files in c programming?