2:10 PM
C++ Program of PRIME NUMBER

Write a Program to show on the screen PRIME NUMBER.

 
#include<iostream.h> 
#include<conio.h> 
 
void main()
{
int num,i,count=0;
clrscr();
printf("\nEnter a number:");
scanf("%d",&num);
for(i=1;i<=num;i++)
{
if(num%i==0)
count++;
}
if(count==2)
printf("%d is a prime number",num);
else
printf("%d is not a prime number",num);
getch();
}
 
 
 
Note:    
           If you want to change in this program please write through the comment on this page. you can also paste similar program of 
             c++ with output.your comment is valuable to the other user and person.
Views: 108 | Added by: vijoriya | Tags: program, PRIME NUMBER, c++ | Rating: 0.0/0
Total comments: 0
avatar