Anyways I am trying to create a program that counts all the prime numbers between 1 and 500. Its executing with no errors or warnings but there is no output
Code:#include <iostream.h> //this program is made to count all //the prime numbers between 1 and 500 int main() { int i=1; int n=2; int prime=0; for(i=1;i<500;i++) { for(n=2;n<500;n++) { if (i%n==0) break; } if ( n==(i-1) ) { cout << i; // all the prime numbers cout << prime; //number of primes prime++; } } return 0; }