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
Does free set pointer to null?
Explain how do you list a file’s date and time?
Why is structure important for a child?
Differentiate between a structure and a union.
How can I handle floating-point exceptions gracefully?
#include main() { char s[] = "Bouquets and Brickbats"; printf(" %c, ",*(&s[2])); printf("%s, ",s+5); printf(" %s",s); printf(" %c",*(s+2)); }
How can you allocate arrays or structures bigger than 64K?
What header files do I need in order to define the standard library functions I use?
a value that does not change during program execution a) variabe b) argument c) parameter d) none
write a program fibonacci series and palindrome program in c
What does c in a circle mean?
Why c is called object oriented language?
What are the loops in c?
What is the difference between ++a and a++?
Why array is used in c?