Write a C program to print 1 2 3 ... 100 without using
loops?
Answers were Sorted based on User's Feedback
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 |
Answer / olga
void printer(int num)
{
if(n==0)
return;
printer(--n);
printf("%d ",n);
}
| Is This Answer Correct ? | 11 Yes | 14 No |
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 |
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 |
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 |
What is #define size in c?
Write a program to reverse a given number in c language?
what are the advantages & disadvantages of unions?
When should structures be passed by values or by references?
What is the value of y in the following code? x=7;y=0; if(x=6) y=7; else y=1;
What is Full Form of C and Why We use C
can anyone proide me reading material on svit00ef27@yahoo.com please thanx in advance
Write a program with dynamically allocation of variable.
What is the difference between text and binary i/o?
How can I write a function that takes a format string and a variable number of arguments?
for(;;) printf("C language") What is out put of above??
2 Answers Practical Viva Questions,
write the program to find multiplication of 2-D matrix??????????