It is possible to solve this problem using loop or a recursion method. And we have already seen the solution using #define directive (Macro expansion) but what if all three are not allowed?
A simple solution is to write the number 100 times in cout statement. A better solution is to use concept of Concept of setjump and longjump in C.
100 times 1.
The same can be written for C also.
This article is contributed by Aditya Rakhecha. If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above.
- How to print a number 100 times without using loop and recursion in C?
- Print a character n times without using loop, recursion or goto in C++
- Print 1 to 100 in C++, without loop and recursion
- How to print N times without using loops or recursion ?
- Write a C program to print "GfG" repeatedly without using loop, recursion and any control structure?
- Print Number series without using any loop
- Program to print binomial expansion series
- Write a C macro PRINT(x) which prints x
- How will you print numbers from 1 to 100 without using loop? | Set-2
- Print a pattern without using any loop
- How will you print numbers from 1 to 100 without using loop?
- Print pattern using only one loop | Set 1 (Using setw)
- Print first m multiples of n without using any loop in Python
- Program to Print Alphabets from A to Z Using Loop
- Print the pattern by using one loop | Set 2 (Using Continue Statement)