Hi everyone! I have really big problem. I wrote myself a program which checks if number that you input is prime number. At first you have to write down how many numbers You would like to check. After compilation program runs. I input:
5
1
11
10
997
88
and at the end of the program there appears a message box with message:
the program has stopped working. I really dont know why :( plz help!
Ok i changed some things but now i have another problem.. Something with algorithm is wrong.. I tested input this:
7
88
88
88
88
999
1
777
and output looks like this:
NO
NO
NO
NO
YES
NO
YES
I don't know how is it possible... I'm fighting with this code so many hours ;(
#include<iostream>
#include<cmath>
using namespace std;
void function()
{
int n=0;
//write down, how many numbers would u like to check
cin >> n;
int *Tab = new int[n];//number which user gives
int *TabPierw = new int[n];//sqrt for each number
Please could you use code tags when posting code, to make it readable? You did it in your OP, and it would help if you could do it in your other posts.