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

What is c definition?

750


What is the meaning of ?

623


How are portions of a program disabled in demo versions?

752


Where are local variables stored in c?

571


How can I make it pause before closing the program output window?

581






Why is structure important for a child?

604


What is huge pointer in c?

586


1) write a program to generate 1st n fibonacci prime numbers using Nested if 2) write a program to generate twin prime numbers from m to n using nested if 3) write a program to check whether a given integer is a strong number or not using nested if 4) Write a program to generate prime factors of a given integer using nested if 5)write a program to generate prime numbers from m to n using nested if 6)write a program to generate perfect numbers from m to n using nested if 7)write a program to generate the pallindromes from m to n using neste if 8)write a program to generate armstrong numbers from m to n using nested if 9)write a program to generate strong numbers from m to n using nested if

3983


How can you find the exact size of a data type in c?

602


What is the difference between printf and scanf in c?

753


What is conio h in c?

625


What is static volatile in c?

577


What is the use of function in c?

715


What are lookup tables in c?

551


List a few unconditional control statement in c.

561