Write a C program to print 1 2 3 ... 100 without using
loops?

Answers were Sorted based on User's Feedback



Write a C program to print 1 2 3 ... 100 without using loops?..

Answer / vikash kumar dixit

#include<stdio.h>
#include<conio.h>
void main()
{
int i,n;
A:
printf("%d",i);
i++;
switch(n)
{
case 100:
break();
default:goto A;
}
getch();
}

Is This Answer Correct ?    0 Yes 1 No

Write a C program to print 1 2 3 ... 100 without using loops?..

Answer / olga

void printer(int num)
{
if(n==0)
return;
printer(--n);
printf("%d ",n);
}

Is This Answer Correct ?    11 Yes 14 No

Write a C program to print 1 2 3 ... 100 without using loops?..

Answer / mwolo fabrice

#include<stdio.h>
#include<conio.h>
void main()
{
int n=100,i;
scanf("%d",&i);
if(i<n)
{
printf("\n %d\n",i);
}
getch();
}

Is This Answer Correct ?    0 Yes 3 No

Write a C program to print 1 2 3 ... 100 without using loops?..

Answer / professor uday kumar bhupathi

void main(int n)
{
if(n==0)
return;
main(--n);
printf("%d ",n);
getch();
}

Is This Answer Correct ?    12 Yes 16 No

Write a C program to print 1 2 3 ... 100 without using loops?..

Answer / vijaya raghavan

#include<stdio.h>
int i=100;
main()
{
if (i==0) return 0;
printf("%d\t",i);
i--;
main();
}

Is This Answer Correct ?    4 Yes 11 No

Post New Answer

More C Interview Questions

extern static int i func() { i =10; i++; printf("%d \n",i); } main() { i =20; printf("%d \n",i); func(); printf("%d \n",i); }

2 Answers  


Explain the red-black trees?

0 Answers  


how can make variable not in registers

1 Answers   TCS,


What is wrong with this program statement?

0 Answers  


question-how to run a c programme.

6 Answers  






Write a program to reverse a given number in c?

0 Answers  


#include<stdio.h> int main(){ int i=10; int *ptr=&i; *ptr=(int *)20; printf("%d",i); return 0; } Output: 20 can anyone explain how came the output is 20

0 Answers  


What are the two types of structure?

0 Answers  


What is structure and union in c?

0 Answers  


How can I implement a delay, or time a users response, with sub-second resolution?

0 Answers  


print ur name 20,000 times without using inbuilt library functions like printf,scanf,gets,puts,getchar or putchar

4 Answers   IBM,


What are conditional operators in C?

0 Answers   Adobe,


Categories