Monday, 24 December 2012
Checking if a number is Krishnamurty number:
Do you like this story?
The program for Checking if a number is Krishnamurty number:
//Krishnamurty number:: abc==a!+b!+c!
#include<stdio.h>
#include<conio.h>
int check(int);
int factorial(int);
void main()
{
int input_number,a;
clrscr();
printf("Enter the number you want to check:");
scanf("%d",&input_number);
a=check(input_number);
if(input_number==a)
{
printf("Yes! The number %d is a Krishnamurty number.",input_number);
}
else
{
printf("No! Its not a Krishnamurty number.");
}
getch();
}
and the output is like:
//Krishnamurty number:: abc==a!+b!+c!
#include<stdio.h>
#include<conio.h>
int check(int);
int factorial(int);
void main()
{
int input_number,a;
clrscr();
printf("Enter the number you want to check:");
scanf("%d",&input_number);
a=check(input_number);
if(input_number==a)
{
printf("Yes! The number %d is a Krishnamurty number.",input_number);
}
else
{
printf("No! Its not a Krishnamurty number.");
}
getch();
}
and the output is like:
This post was written by: Franklin Manuel
Franklin Manuel is a professional blogger, web designer and front end web developer. Follow him on Twitter
Subscribe to:
Post Comments (Atom)
0 Responses to “Checking if a number is Krishnamurty number:”
Post a Comment