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

Answer Posted / uma maheswari

#include<stdio.h>
#include<conio.h>
int i=1;
void main()
{
i<=100 ? printf("%d\n",i) : getch(); //conditional operator
i++;
main(); //recursive calling of main() function
}

Is This Answer Correct ?    10 Yes 7 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is it possible to have a function as a parameter in another function?

594


What is a pointer in c plus plus?

688


Explain pointers in c programming?

629


a construct the"else" part of "if" statement contains anoth "if else" statement is called a) if-else b) else-if-else c) if-else-if-else d) chain if/if-else-if

697


write a program to display all prime numbers

1452






which type of aspect you want from the student.

1697


C language questions for civil engineering

1235


Tell me when would you use a pointer to a function?

603


What is the role of this pointer?

545


An integer that indentifies the position of a data item in a sequence of data items a) value b) number c) index d) all of the above

643


Explain how does free() know explain how much memory to release?

569


What do you understand by normalization of pointers?

619


Want to know how to write a C program that connects to a MySQL server and checks if the InnoDB plug-in is installed on it. If so, your program should print the total number of disk writes by MySQL.

1515


i have a written test for microland please give me test pattern

2177


What does & mean in scanf?

599