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

Is stack a keyword in c?

638


what is the syallabus of computer science students in group- 1?

1845


What is the description for syntax errors?

616


What is the use of getch ()?

639


while loop contains parts a) initialisation, evalution of an expression,increment /decrement b) initialisation, increment/decrement c) condition evalution d) none of the above

743






What does main () mean in c?

616


What is the purpose of 'register' keyword?

692


Can i use “int” data type to store the value 32768? Why?

757


What is the use of a static variable in c?

595


Explain what could possibly be the problem if a valid function name such as tolower() is being reported by the c compiler as undefined?

585


how do you execute a c program in unix.

637


how can i access hard disk address(physical address)? are we access hard disk by using far,near or huge pointer? if yes then please explain.....

1373


What is define directive?

643


In a switch statement, explain what will happen if a break statement is omitted?

640


Tell me the use of bit field in c language?

630