Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


write a program to display numbers from 1 to 10 and 10 to 1?

Answers were Sorted based on User's Feedback



write a program to display numbers from 1 to 10 and 10 to 1?..

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

write a program to display numbers from 1 to 10 and 10 to 1?..

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

Post New Answer

More C Interview Questions

how many types of operators are include in c language a) 4 b) 6 c) 8 d) 12

0 Answers  


increment operateor (++)and decrament(--) #include<stdio.h> #inclide<conio.h> main() { int x=15; while(x!=0) scanf("%d",&x); {

2 Answers   HCL, Syntel, TCS,


What is #include conio h?

0 Answers  


What are .h files and what should I put in them?

3 Answers  


In C language what is a 'dangling pointer'?

0 Answers   Accenture,


If 4 digits number is input through the keyboard, Write a program to calculate sum of its 1st & 4th digit.

12 Answers   Google,


Explain what is the difference between functions getch() and getche()?

0 Answers  


What is file in c language?

0 Answers  


What is the purpose of the statement: strcat (S2, S1)?

0 Answers  


What is sparse file?

1 Answers  


Given an array of characters which form a sentence of words, give an efficient algorithm to reverse the order of the words (not characters) in it?

3 Answers  


differentiate between const char *a; char *const a; and char const *a;

2 Answers   College School Exams Tests, HCL, TCS,


Categories