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

Write a program to swap two numbers without using the third variable?

0 Answers  


Program to find the sum of digits of a given number until the sum becomes a single digit

8 Answers   InterGraph,


what are the advantages & disadvantages of unions?

2 Answers  


how to find greatet of 10 numbers without using array?

4 Answers  


Why should I prototype a function?

0 Answers  






write a program to find the frequency of a number

4 Answers   Infosys,


What is the 'named constructor idiom'?

0 Answers  


Write a program that receives as input a number omaadel-n-print, four digits.

0 Answers  


Write code for atoi(x) where x is hexadecimal string.

5 Answers   Adobe,


Why clrscr is used after variable declaration?

0 Answers  


write a own function for strstr

1 Answers   LG Soft,


how to find out the inorder successor of a node in a tree??

2 Answers   TCS, Yahoo,


Categories