Hi!
I need to create a program that would request person to type one number and than print if it's a prime number or not.
I have no idea how to start this.
#include<iostream>
main()
{
int num,i;
cout<<"Enter the any no.=";
cin>>num;
for(i=2;i<=num;i++)
{
if(num%i==0)
{
break;
}
}
if(i==num)
{
cout<<"The number entered is a PRIME no.";
}
else
{
cout<<"The number entered is NOT a PRIME no.";
}
You shouldn't hand people answers if they haven't written any code themselves, and please use [code][/code] tags, the <> picture to the right of the reply box.