It is possible to solve this problem using loop or a recursion method but what if both are not allowed?
A simple solution is to write the number 100 times in cout statement. A better solution is to use #define directive (Macro expansion)
Output: 100 times 1.
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.
GeeksforGeeks has prepared a complete interview preparation course with premium videos, theory, practice problems, TA support and many more features. Please refer Placement 100 for details
- Print a number 100 times without using loop, recursion and macro expansion 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 will you print numbers from 1 to 100 without using loop? | Set-2
- How will you print numbers from 1 to 100 without using loop?
- Change/add only one character and print '*' exactly 20 times
- Print substring of a given string without using any string function and loop in C
- C/C++ For loop with Examples
- C/C++ while loop with Examples
- C/C++ do while loop with Examples
- Difference between while and do-while loop in C, C++, Java
- A nested loop puzzle
- How to concatenate two integer arrays without using loop in C ?
- What happens if loop till Maximum of Signed and Unsigned in C/C++?
- Why are elementwise additions much faster in separate loops than in a combined loop?