Computer Science, asked by soudamansoormm, 4 months ago

write a program to accept a number and check and diplay whether it is a spy number or not.(a number is a spy number if the sum of its digits equal the product of its digit)
example:consider the number 1124
sum of digits=1+1+2+4=8
product of digits =1*1*2*4=8

Answers

Answered by Mister360
0

Explanation:

Co.de:-

#include <stdio.h>

#include <stdio.h>int main() {

#include <stdio.h>int main() { int num, i;

#include <stdio.h>int main() { int num, i; printf("Enter a positive integer: ");

#include <stdio.h>int main() { int num, i; printf("Enter a positive integer: "); scanf("%d", &num);

#include <stdio.h>int main() { int num, i; printf("Enter a positive integer: "); scanf("%d", &num); printf("Factors of %d are: ", num);

#include <stdio.h>int main() { int num, i; printf("Enter a positive integer: "); scanf("%d", &num); printf("Factors of %d are: ", num); for (i = 1; i <= num; ++i) {

#include <stdio.h>int main() { int num, i; printf("Enter a positive integer: "); scanf("%d", &num); printf("Factors of %d are: ", num); for (i = 1; i <= num; ++i) { if (num % i == 0) {

#include <stdio.h>int main() { int num, i; printf("Enter a positive integer: "); scanf("%d", &num); printf("Factors of %d are: ", num); for (i = 1; i <= num; ++i) { if (num % i == 0) { printf("%d ", i);

#include <stdio.h>int main() { int num, i; printf("Enter a positive integer: "); scanf("%d", &num); printf("Factors of %d are: ", num); for (i = 1; i <= num; ++i) { if (num % i == 0) { printf("%d ", i); }

#include <stdio.h>int main() { int num, i; printf("Enter a positive integer: "); scanf("%d", &num); printf("Factors of %d are: ", num); for (i = 1; i <= num; ++i) { if (num % i == 0) { printf("%d ", i); } }

#include <stdio.h>int main() { int num, i; printf("Enter a positive integer: "); scanf("%d", &num); printf("Factors of %d are: ", num); for (i = 1; i <= num; ++i) { if (num % i == 0) { printf("%d ", i); } } return 0;

#include <stdio.h>int main() { int num, i; printf("Enter a positive integer: "); scanf("%d", &num); printf("Factors of %d are: ", num); for (i = 1; i <= num; ++i) { if (num % i == 0) { printf("%d ", i); } } return 0;}

Similar questions