Saturday, July 13, 2019

Prime Number

Prime Number Or Not.

prime number or not


#include<stdio.h>
#include<conio.h>

void main()
{
int no,sum=0,temp,remainder;
clrscr();
printf("Enter The Number :- ");
scanf("%d",&no);

temp=no;

while(no>0)
{
remainder=no%10;
sum=sum+(remainder*remainder*remainder);
no=no/10;
}
if(temp==sum)
{
printf("Armstrong number ");
}
else
{
printf("Not Armstrong number ");
}

getch();
}

Output:


prime number output


EmoticonEmoticon