Program to find prime number (C++) – Basic C++ Programming

Program to find prime number in C++


#include <stdio.h>
#include <conio.h>
void main()

int n, i;
printf(“Enter number:”);
scanf(“%d”, &n);
for(i = 2; i <= n / 2; ++i)
      if(n % i == 0)
      printf ("Prime number");



Program to find square and cube of a number

“My posts/articles/images are not allowed to be stolen/copied anywhere at Cyber space. Doing so will allow me to take a legal action against the copier.”

Related Posts

M.Bakhtiar Zuberi
Hello, I'm M.Bakhtiar Zuberi, the only article poster & owner of this website. Your comments/suggestions are welcomed the most! is a part of network.

Leave a Comment

Kindly solve the following puzzle to prove that you\'re not a bot: