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 |
Explain 'bit masking'?
What is a ternary operator in c?
What are the loops in c?
PROGRAM TO WRITE CONTENTS OF 1 FILE IN REVERSE TO ANOTHER FILE,PROGRAM TO COPY 1 FILE TO ANOTHER BY SPECIFYING FILE NAMES AS COMMAND LINE
What is the scope of static variables in c language?
What is the meaning of c in c language?
why we use pointer in c
what is the difference between const volatile int i & volatile const int j;
what will be the out put. #include<stdio.h> void main() { printf("Output:"); printf(1+"vikashpatel"); }//output: ikashpatel
When reallocating memory if any other pointers point into the same piece of memory do you have to readjust these other pointers or do they get readjusted automatically?
can u give me the good and very optimised code for a car racing game?
What is the difference between procedural and declarative language?