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 |
Define macros.
What are the different types of constants?
write a program using linked list in which each node consists of following information. Name[30] Branch Rollno Telephone no i) Write the program to add information of students in linked list
Design a program which assigns values to the array temperature. The program should then display the array with appropriate column and row headings.
Can a pointer be static?
Explain argument and its types.
what is diognisis?
What is the value of y in the following code? x=7;y=0; if(x=6) y=7; else y=1;
What is I ++ in c programming?
What is #define?
wtite a program that will multiply two integers in recursion function
What is memory leak in c?