Hey guys.... im taking this programming course in college... and i actually need some help............ i need to make a program using C++ to print prime numbers...............
plzzz help!!!!
thanks in advance!
Page
of
1Hey guys.... im taking this programming course in college... and i actually need some help............ i need to make a program using C++ to print prime numbers...............
plzzz help!!!!
thanks in advance!
🏏 IPL 2026: Match 3, RR vs CSK at Guwahati 🏏
🏏 IPL 2026: Match 4, PBKS vs GT at New Chandigarh🏏
EK DIL & EK JAAN 30.3
Newyork (2009)..Did the movie humanize terrorists?
Coming Soon - Rama Official Teaser - Ramayana
NAACH-GAANA 31.3
Who saved Yaman-The dragon
Originally posted by: pinka_anshu
/*prime number check between 1 to a range , range will be enter by user*/
#include<iostream.h>
#include<conio.h>
void main()
{
int num;
clrscr();
cout<<"enter value till to be check";
cin>>num;/*all prime number will be chacke between 1 to num*/
if( num!=1)
{
for(int i=2;i<num+1;i++)
{
int flag=0;
for(int j=2;j<i;j++)
{ if (i%j==0)
flag=1;
}
if(flag==0)
cout<<"\n"<< i; /* print the prime number between 1 to num*/
}
}
else
cout<< num<<"is prime number";
getch();
}
Originally posted by: AsliiGuy
Wow 👏
So amazing that you all know this...C++ is hard...Good work, 😊