The Artima Developer Community
Sponsored Link

Java Buzz Forum
C program to print 1 to 100 without using loop

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
instanceof java

Posts: 576
Nickname: instanceof
Registered: Jan, 2015

instanceof java is a java related one.
C program to print 1 to 100 without using loop Posted: May 19, 2017 9:21 PM
Reply to this message Reply

This post originated from an RSS feed registered with Java Buzz by instanceof java.
Original Post: C program to print 1 to 100 without using loop
Feed Title: Instance Of Java
Feed URL: http://feeds.feedburner.com/blogspot/TXghwE
Feed Description: Instance of Java. A place where you can learn java in simple way each and every topic covered with many points and sample programs.
Latest Java Buzz Posts
Latest Java Buzz Posts by instanceof java
Latest Posts From Instance Of Java

Advertisement
  • Print 1 to 100 without using loop in c
  • We print 1 to n numbers without using any loop.
  • By using recursive function in C Programming we can print 1 to 100 or 1 to n numbers.
  • Now We will write a C program to print one to 100 without using any loops.
  • Print 1 to 100 without loop and recursion



 Program #1: Write a C program to print 1 to 100 without loop and using recursive function.


  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. int print(int num);
  4. int main(int argc, char *argv[])
  5. {
  6.     int number = 1;
  7.  
  8.     print(number);
  9.  
  10.    return 0;
  11. }
  12. int print(int number){
  13.     if(number<=100){
  14.          printf("%d ",number);
  15.          print(number+1);
  16.     }
  17. }
   
Output:


print 1 to 100 in c

Read: C program to print 1 to 100 without using loop

Topic: C program to print given number in words Previous Topic   Next Topic Topic: Write a C program to swap two integer arrays

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use