C complete programming for b-tech students
Wednesday, 6 July 2011
C programme for armstrong or not
#include <stdio.h>
#include <conio.h>
void main()
{
int n,num,a,b,c;
clrscr();
printf("enter a number");
a=n%10;
b=n/10%10;
c=(n/10)/10;
num=a*a*a+b*b*b+c*c*c;
if(n==num)
printf("armstrong number");
else
printf("not a armstrong number");
}
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment