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

Answer Posted / harsha

#include<stdio.h>

int i=0;

void main()
{
if(i==0)
clrscr();
if(i<100) {
printf("%d \t",++i);
main(); }
else {
getch();
exit(0); }
}

Is This Answer Correct ?    2 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

find the value of y y = 1.5x+3 for x<=2 y = 2x+5 for x>2

1533


Explain what is a program flowchart and explain how does it help in writing a program?

653


please explain every phase in the "SDLC" in the dotnet.

2182


Why does notstrcat(string, "!");Work?

646


Can you subtract pointers from each other? Why would you?

563






Can a pointer be static?

629


a) Identify the following declarations. Ex. int i (integer variable) float a[l0](array of 10 real nos) int (*f())() void *f int (*f()) [] void *f int f[] [] [] char *(*f) () int (*f[]) [] float(*f) [] [] float **f int ******f

1589


What do the functions atoi(), itoa() and gcvt() do?

728


Can we change the value of static variable in c?

568


why we wont use '&' sing in aceesing the string using scanf

1787


What is register variable in c language?

609


hi folks i m approching for h1 b interview on monday 8th of august at montreal and i m having little problem in my approval notice abt my bithdate my employer has made a mistake while applying it is 12th january and istead of that he had done 18 the of january do any body have any solution for that if yes how can i prove my visa officer abt my real birthdate it urgent please let me know guys thaks dipesh patel

1416


Why is structure important for a child?

607


Explain how can you tell whether two strings are the same?

587


What is difference between structure and union in c programming?

575