Let’s write a C Program to print list of Prime numbers. This program will be useful for you to understand the basic concepts in C programming such as,
- How to get a user input value in C
- How to write for loop in C
- How to get the remainder value using modules in C
See the script:
#includeint main() { int limit, i=0, j=0; //print a string about the program printf("Let's print Prime Numbers\n"); printf("Enter the Limit: "); //get the limit scanf("%d", &limit); //loop till i equals to limit for (i = 1; i The output of the program will be:
Just go through the comments in the above program to understand each line. Bye!
The post C Program to print Prime Numbers appeared first on TutorialsMade.