write a program to display numbers from 1 to 10 and 10 to 1?
Answers were Sorted based on User's Feedback
Answer / 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 |
Answer / sureshmca
#include<stdio.h>
void main()
{
int num,i;
for(num=0;num<=10;num++)
{
printf("%d",num);
}
}
| Is This Answer Correct ? | 3 Yes | 9 No |
Find duplicates in a file containing 6 digit number (like uid) in O (n) time.
What is a global variable in c?
What is the diffrent between while and do while statement ?
what is the output on the screen? int n; n=printf("my name is %d",printf("kiran %d",printf("kumar"))); printf("\n %d \n",n);
How to find the given no is odd or even without checking of any condition and loops. (Hint: Using array)
When do we get logical errors?
main() { int x=5; printf("%d %d %d\n",x,x<<2,x>>2); } what is the output?
What is the mean of function?
enum DAY { sunday, monday, tuesday }; enum EDAYS { friday, saturday, sunday }; void main() { int i =0; if( i == sunday) { printf("%d",i); } } what would be the output?
Why is c faster?
how can we use static and extern?and where can we use this?
How can you find the exact size of a data type in c?