a simple c program using 'for' loop to display the output
5
4
3
2
1
Answers were Sorted based on User's Feedback
Answer / prayashjeet chanda
#include<stdio.h>
#include<conio.h>
void main()
{
clrscr();
int num,i;
printf("\nEnter a number: ");
scanf("%d",&num);
for(i=num;i>0;i--)
{
printf("\n%d",i);
}
getch();
}
Is This Answer Correct ? | 0 Yes | 0 No |
Answer / rohit dilip kakade
#include<stdio.h>
#include<conio.h>
void main(void)
{
int i;
clrscr();
for(i=5;i>0;i--)
{
printf("
%d",i);
}
getch();
}
Is This Answer Correct ? | 0 Yes | 0 No |
du u know test pattern for robosoft? Plz share
1 Answers RoboSoft, TATA, Wipro,
void main() { int s[4][2]={ {1234,56},{1212,33},{1434,80},{1312,78} }; int (*p)[2]; int i,j,*pint; for(i=0;i<=3;i++) { p=&s[i]; pint=p; printf("\n"); for(j=0;j<=1;j++) printf("%d",*(pint+j)); } } while running this program it shows a warning-suspicious pointer conversion ie pint=p; my que is why should we assign the value of p to pint again.why cant we use it directly as *(p+j)..but if i use like tat the o/p is garbage value..
What is malloc() function?
What is the heap?
If an old women's age is the same as her three grand daughters i,mean the number of days old child=the no of weeks old child=no of months old child .The total yrs of all these ppl is 114 yrs...then how old is the old woman? the yr has 365 days..and 30 days each month.
why arithmetic operation can’t be performed on a void pointer?
how to find sum of digits in C?
int i=0,j; j=++i + ++i ++i; printf(" %d",j);
What is assert and when would I use it?
What is the difference between #include and #include 'file' ?
What is the difference between constant pointer and constant variable?
What is an identifier?