WAP to display 1,2,3,4,5........N
Answers were Sorted based on User's Feedback
Answer / sreejesh1987
#include<stdio.h>
#include<conio.h>
void main()
{
int i,n;
clrscr();
printf("\nEnter n:");
scanf("%d",&n);
for(i=1;i<=n;i++)
printf("%d ",i);
getch();
}
Is This Answer Correct ? | 11 Yes | 3 No |
Answer / arti sharma
void main()
{ int i,n,k;
printf("enter the limit");
scanf("%d",&n);
k=1;
i:
if(k<=n)
{ printf("%d",k);
k++;
goto i;
}
getch();
}
Is This Answer Correct ? | 2 Yes | 0 No |
how to swap 3 nos without using temporary variable
Find your day from your DOB?
15 Answers Accenture, Microsoft,
How to palindrom string in c language?
main() { int i=5,j=10; i=i&=j&&10; printf("%d %d",i,j); }
char inputString[100] = {0}; To get string input from the keyboard which one of the following is better? 1) gets(inputString) 2) fgets(inputString, sizeof(inputString), fp)
void main() { int *mptr, *cptr; mptr = (int*)malloc(sizeof(int)); printf(ā%dā,*mptr); int *cptr = (int*)calloc(sizeof(int),1); printf(ā%dā,*cptr); }
main() { int i=5; printf("%d%d%d%d%d%d",i++,i--,++i,--i,i); }
main() { int i, j; scanf("%d %d"+scanf("%d %d", &i, &j)); printf("%d %d", i, j); } a. Runtime error. b. 0, 0 c. Compile error d. the first two values entered by the user
main() { extern int i; { int i=20; { const volatile unsigned i=30; printf("%d",i); } printf("%d",i); } printf("%d",i); } int i;
enum colors {BLACK,BLUE,GREEN} main() { printf("%d..%d..%d",BLACK,BLUE,GREEN); return(1); }
What is wrong with the following code? int *foo() { int *s = malloc(sizeof(int)100); assert(s != NULL); return s; }
What is full form of PEPSI