How can i find first 5 natural Numbers without using any
loop in c language????????

Answers were Sorted based on User's Feedback



How can i find first 5 natural Numbers without using any loop in c language????????..

Answer / vaishno

main()
{
int i=1;
printt:
printf("%d\n",i++);
if(i<=5)
goto printt;
getch();
}

Is This Answer Correct ?    16 Yes 5 No

How can i find first 5 natural Numbers without using any loop in c language????????..

Answer / i.c.jacobpaul

main()
{
int i=1;
printt:
printf("%d\n",i);
i++;
if(i<=5)
goto printt;
getch();
}

Is This Answer Correct ?    1 Yes 6 No

Post New Answer

More C Code Interview Questions

What is the match merge ? compare data step match merge with proc sql merge - how many types are there ? data step vs proc sql

0 Answers  


main() { 41printf("%p",main); }8

1 Answers  


main() { printf("\nab"); printf("\bsi"); printf("\rha"); }

3 Answers  


4. Main() { Int i=3,j=2,c=0,m; m=i&&j||c&I; printf(“%d%d%d%d”,I,j,c,m); }

2 Answers   Broadridge,


How to use power function under linux environment.eg : for(i=1;i<=n;i++){ pow(-1,i-1)} since it alerts undefined reference to 'pow'.

2 Answers  






how to return a multiple value from a function?

2 Answers   Wipro,


Cluster head selection in Wireless Sensor Network using C programming language.

0 Answers  


union u { union u { int i; int j; }a[10]; int b[10]; }u; main() { printf("\n%d", sizeof(u)); printf(" %d", sizeof(u.a)); // printf("%d", sizeof(u.a[4].i)); } a. 4, 4, 4 b. 40, 4, 4 c. 1, 100, 1 d. 40 400 4

3 Answers   HCL,


#include<stdio.h> #include<conio.h> void main() { int a=(1,2,3,(1,2,3,4); switch(a) { printf("ans:"); case 1: printf("1");break; case 2: printf("2");break; case 3: printf("1");break; case 4: printf("4");break; printf("end"); } getch(); }

0 Answers  


how can u draw a rectangle in C

53 Answers   Accenture, CO, Codeblocks, Cognizant, HCL, Oracle, Punjab National Bank, SAP Labs, TCS, University, Wipro,


#define SQR(x) x * x main() { printf("%d", 225/SQR(15)); } a. 1 b. 225 c. 15 d. none of the above

3 Answers   HCL,


struct point { int x; int y; }; struct point origin,*pp; main() { pp=&origin; printf("origin is(%d%d)\n",(*pp).x,(*pp).y); printf("origin is (%d%d)\n",pp->x,pp->y); }

1 Answers  


Categories