mirror of
https://github.com/TheAlgorithms/C
synced 2024-11-22 05:21:49 +03:00
Merge pull request #99 from viditkulshreshtha/master
Thanks for contribute
This commit is contained in:
commit
086fdac6f0
@ -1,7 +1,7 @@
|
||||
#include <stdio.h>
|
||||
|
||||
int fat(int number){
|
||||
if (number == 1)
|
||||
if (number == 1 || number == 0)
|
||||
return 1;
|
||||
else
|
||||
return number*fat(number-1);
|
||||
@ -17,4 +17,4 @@ int main(){
|
||||
printf("%d\n", fat(number));
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
@ -14,11 +14,11 @@ int main()
|
||||
}
|
||||
if (sum==num)
|
||||
{
|
||||
printf("%d is an armstrong number!", num);
|
||||
printf("%d is an armstrong number!\n", num);
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("%d is not an armstrong number!", num);
|
||||
printf("%d is not an armstrong number!\n", num);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user