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
When the macros gets expanded?
What is the Purpose of 'extern' keyword in a function declaration?
What is a wrapper function in c?
How can I find the modification date and time of a file?
Explain what is dynamic data structure?
What is quick sort in c?
The difference between printf and fprintf is ?
what is diffrence between linear and binary search in array respect to operators?what kind of operator can be used in both seach methods?
What is wild pointer in c with example?
What is this pointer in c plus plus?
What is keyword with example?
How to throw some light on the b tree?
Program to find the sum of digits of a given number until the sum becomes a single digit. (e.g. 12345=>1+2+3+4+5=15=>1+5=6)
can any one please explain, how can i access hard disk(physical address)? it is possible by the use of far,near or huge pointer? if yes then please explain......
Can variables be declared anywhere in c?