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 email@example.com. 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.
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.
- 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
- Write a C program to print "GfG" repeatedly without using loop, recursion and any control structure?
- How to print N times without using loops or recursion ?
- How will you print numbers from 1 to 100 without using loop?
- How will you print numbers from 1 to 100 without using loop? | Set-2
- Write a C macro PRINT(x) which prints x
- Print substring of a given string without using any string function and loop in C
- Difference between Inline and Macro in C++
- The OFFSETOF() macro
- CRASH() macro - interpretation
- C | Macro & Preprocessor | Question 1
- C | Macro & Preprocessor | Question 2
- C | Macro & Preprocessor | Question 14
- C | Macro & Preprocessor | Question 4
- C | Macro & Preprocessor | Question 5
- C | Macro & Preprocessor | Question 6
- C | Macro & Preprocessor | Question 7
- C | Macro & Preprocessor | Question 8