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 |
Why do we use & in c?
How is pointer initialized in c?
Write a program to check prime number in c programming?
How do you determine if a string is a palindrome?
typedef enum { html, java, javascript, perl, cgi } lang;The above statement defines a : a) Union b) User defined type c) Enumerated variable d) none
What is the difference between null pointer and void pointer
10 Answers CTS, Manforce, MAQ Software,
Whats wrong with the following function char *string() { char *text[20]; strcpy(text,"Hello world"); return text; }
To find whether a number is even or odd without using any conditional operator??
12 Answers College School Exams Tests, IBM,
What is the importance of c in your views?
What is the maximum length of an identifier?
What’s the special use of UNIONS?
Find the second largest element in an array with minimum no of comparisons and give the minimum no of comparisons needed on an array of size N to do the same.