This function causes the program to terminate from any portion of the program and does not have any return value. It has only one argument whose value is returned to the operating system when the program is terminated. This function is included in the <stdlib.h> header file. Hence this header file must be included in the beginning of the program.
To find whether a given number is prime or not using do ..while loop.
cout<<"Enter the Number : ";
cout<<n<<" is a prime number ";
cout<<"Not a prime number "<<"\n";