M.Sunil Kumar
Answered On : Dec 5th, 2006
main()
{
int amm=0,temp=0,n,x;
printf("enter thealue of n");
scanf("%d",&n);
x=n;
for(;n>0;)
{
temp=n%10;
amm=amm+(temp*temp*temp);
n=n/10;
}
if(x==n)
{
printf("THE GIVEN NUMBER IS AMSTRONG NUMBER");
}
else
printf("NOT AMSTRONG NUMBER");
}

4 Users have rated as useful.
Login to rate this answer.
pradipc
Answered On : Dec 6th, 2006
q6
show(int i)
3 {
4 i&&show(i-1);
5 printf("%d", i);
6 }
7 main()
8 {
9 show (10);
10 }

1 User has rated as useful.
Login to rate this answer.
mekala
Answered On : Jan 8th, 2007
#include<stdio.h>
int main()
{
int i,j,k,l,m;
printf("give the number to find Amswrong (three digit)");
scanf("%d",&i);
j=i/100;
k=i%100;
l=k/10;
m=k%10;
j=j*j*j;
l=l*l*l;
m=m*m*m;
if(i==j+l+m)
{
printf("yes %d is an Amswrong numbern",i);
}
else
printf("not an Amswrong number");
}

1 User has rated as useful.
Login to rate this answer.
Armstrong number is a number that in a given base is the sum of its own digits to the power of the number of digits.For example:1 + 5 + 3 = 153 To put it algebraically, let be an integer with representation dkdk − 1...d1 in base-b notation. If for some m it happens that then n is a narcissistic number (or an m-narcissistic number).In "A Mathematician's Apology", G. H. Hardy wrote:"There are just four numbers, after unity, which are the sums of the cubes of their digits:153 = 13 + 53 + 33370 = 33 + 73 + 03371 = 33 + 73 + 13and 407 = 43 + 03 + 73. These are odd facts, very suitable for puzzle columns and likely to amuse amateurs, but there is nothing in them which appeals to the mathematician."However, it is not known if the only base 10 numbers equal to the sum of the cubes of their digits are 1, 153, 370, 371, and 407.Some "base ten" Armstrong numbers are: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 153, 370, 371, ... (sequence A005188 in OEIS)Some "base three" Armstrong numbers are: 0,1,2,12,122Some "base four" Armstrong numbers are: 0,1,2,3,313
Login to rate this answer.
G Siva Prakash Reddy
Answered On : Oct 18th, 2007
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
static void reverse_file(char *, unsigned int);
int main(int argc, char **argv)
{
char *ptr;
unsigned int size, count = 0;
FILE *fp;
if(argc < 2)
{
printf("%s n", argv[0]);
return EXIT_FAILURE;
}
if(!(fp = fopen(argv[1], "r")))
return EXIT_FAILURE;
fseek( fp, 0L, SEEK_END );
count = ftell( fp );
rewind(fp);
if(!(ptr = malloc(count+1)))
return EXIT_FAILURE;
ptr[count] = '