Welcome to our blog Contact Us Subscribe!

Print Natural Numbers from 1 to 100 in C

Here, in this blog post, I have shared code for natural numbers from 1 to 100 in C Programming Language.

Print Natural Numbers from 1 to 100 in C

Here, in this blog post, I have shared code for natural numbers from 1 to 100 in C Programming Language.

Print Natural Numbers from 1 to 100 in C

#include <stdio.h>

int main() {
    int i;
    for(i = 1; i <= 100; i++) {
        printf("%d ", i);
    }
    return 0;
}

Explanation:

  1. The for loop iterates from 1 to 100 using the loop variable i.
  2. The loop body contains a printf statement that prints the value of i followed by a space.
  3. The loop ends when i becomes greater than 100.
  4. The program returns 0 to indicate successful execution.

About the Author

Hi! I am Sailesh Rijal, A Fronted Web Developer at AliveCoder. If you ask me for my short introduction then I would love to tell my self as a noob web designer who wants to learn and grow everyday.

Post a Comment

Cookie Consent
We serve cookies on this site to analyze traffic, remember your preferences, and optimize your experience.
Oops!
It seems there is something wrong with your internet connection. Please connect to the internet and start browsing again.
AdBlock Detected!
We have detected that you are using adblocking plugin in your browser.
The revenue we earn by the advertisements is used to manage this website, we request you to whitelist our website in your adblocking plugin.
Site is Blocked
Sorry! This site is not available in your country.