Hey. I have this assignment in which i've to generate prime numbers up to a certain limit. Since i'm extremely new to C++ so i have absolutely no idea what's wrong with the program i have written. I have to keep it simple for my understanding. I've written it in Turbo C++ Here:
#include <iostream.h>
#include <conio.h>
void main()
{
clrscr();
int i,j,k;
cout<<"Enter range "<<k;
cin>>k;
for(i=2;i<=k;i++)
{
for(j=2;j<=i;j++)
{
if(i%j!=0)
cout<<i;
}
}
getch();
}