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


Please Help Members By Posting Answers For Below Questions

What is the code for 3 questions and answer check in VisualBasic.Net?

1696


What is clrscr ()?

641


What is the difference between the local variable and global variable in c?

535


Is multithreading possible in c?

572


Is there sort function in c?

581






What is #include stdio h?

689


how do you programme Carrier Sense Multiple Access

1522


How can you increase the size of a dynamically allocated array?

647


What is a const pointer in c?

675


how to execute a program using if else condition and the output should enter number and the number is odd only...

1661


How is a macro different from a function?

659


Why clrscr is used in c?

591


Differentiate between full, complete & perfect binary trees.

675


Is there a way to have non-constant case labels (i.e. Ranges or arbitrary expressions)?

585


What are header files in c programming?

660