write a program to display numbers from 1 to 10 and 10 to 1?
Answer Posted / sai
#include<stdio.h>
#include<conio.h>
void main()
{
int i;
clrscr();
for(i=1;i<=10;i++)
printf(" %d",i);
printf("\n");
for(i=10;i>=1;i--)
printf(" %d",i);
getch();
}
/* output
1 2 3 4 5 6 7 8 9 10
10 9 8 7 6 5 4 3 2 1 */
| Is This Answer Correct ? | 6 Yes | 2 No |
Post New Answer View All Answers
Explain what is a pragma?
What does s c mean in text?
What is the difference between call by value and call by reference in c?
Why do we use & in c?
Write a program in "C" to calculate the root of a quadratic equation ax^2+bx+c=0, where the value of a,b & c are known.
What is a example of a variable?
Is return a keyword in c?
I need a sort of an approximate strcmp routine?
What is use of pointer?
What is the purpose of void in c?
What is the explanation for modular programming?
How can I recover the file name given an open stream or file descriptor?
Differentiate fundamental data types and derived data types in C.
Write a program to implement queue.
What is a nested formula?