jituTechnology

jituTechnology

Write a program to print all the prime numbers from 1 to 500. (A prime number is one which is divisible by 1 or itself)

Here is the c source code/program for: Write a program to print all the prime numbers from 1 to 500. (A prime number is one which is divisible by 1 or itself)

/* a program to print all prime number from 1 too 500
programmed by:
Name: Jitendra Kumar Yadav
Roll: 16
Dtae: 12 feb 2011 */
#include <stdio.h>
#include <conio.h>
void main()
{
     int i,j;
   for(i=2; i<=500; i++)
   {
     for(j=2; j<i; j++)
      {
           if(i%j==0)
           {
                break;
            }
      }
     if (i==j)
      printf(“%d\t”,i);
   }
   getch();
}

No comments yet.

Add a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.



Connect with Me

GPO 8973 NPC 541; Kathmandu Nepal
Phone: +977 9851236800

Calendar

January 2026
S M T W T F S
 123
45678910
11121314151617
18192021222324
25262728293031