Search This Blog

Sunday, March 22, 2020

Spyn number [C programming]

                                    C-Programming:-

In this tutorial yon will learn:-

 

Write a program to check whether a number spy or not.

#include<stdio.h>
#include<conio.h>
void main()
{
int n,sum=0,product=1,r;
printf("Enter any number");
scanf("%d",&n);
while(n>0)
{
r=n%10;
sum=sum+r;
product=product*r;
n=n/10;
}
if(sum=product)
{
printf("number is spy");
}
else
{
printf("number is not spy");
}
getch();
}

Mr. abhijeet dwivedi

Developer

Hey, I'm Abhijeet

0 comments:

Post a Comment

If you have any doubt, please let me know