#include <stdio.h> #include <conio.h> void main(){ int num,i; clrscr(); printf("*****PRIME NUMBER*****\n\n"); printf("Enter the number to find it is prime or not : "); scanf("%d",&num); for(i=2;i<num;i++){ if(num%i==0){ printf("\n\n%d is Not a Prime Number\n",num); printf("It is divisible by %d, ...",i); gotoout; } } printf("\n\n%d is a PRIME number",num); out: getch(); }
This Blog is All about various C & C++ programs using Graphics.h header files. The programs are Compiled using Turbo C++ & C .Here i will be posting source codes of programs in C or C++ or Computer Graphics
Code for Program to find entered number is prime number or not in C Programming
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment