How do you write c program to test whether a number is krishnamurti number or not?

1 answer

Answer

1025759

2026-04-14 18:40

+ Follow

#include<stdio.h>

#include<conio.h>

void main()

{

int n,dig,sum,temp;

clrscr();

printf("Enter a no");

scanf("%d",&n);

temp=n;

sum=0;

while(n!=0)

{

digit=n%10;

f=1;

for(i=1; i<=digit; i++)

f=f*i;

sum=sum+f;

n=n%10;

}

if(sum==temp)

printf("it is a krishnamurti no");

{

else

printf("it is not a krishnamurti no");

}

getch();

}

ReportLike(0ShareFavorite

Copyright © 2026 eLLeNow.com All Rights Reserved.