Write a program to know whether the input number is an armstrong number.
Answer / Abhinav Awasthi
Here's an example of a simple C program that checks if a number is an Armstrong number. Note that this program assumes the input number to be a positive integer less than 1000 for efficiency.n```n#include <stdio.h>nvoid armstrong(int n){ // function to check armstrong numbertint i, sum = 0, temp = n;n while (temp > 0){ntsum += (temp % 10) * (temp % 10) * (temp % 10);ntemp /= 10;n}n if (sum == n) printf("%d is an Armstrong number.", n);n else printf("%d is not an Armstrong number.", n);n}nint main(){n int num; /* input number */nprintf("Enter a positive integer less than 1000: ");nscanf("%d", &num);narmstrong(num);nreturn 0;n}n```
| Is This Answer Correct ? | 0 Yes | 0 No |
Write a program for deleting duplicate elements in an array
Output for following program using for loop only * * * * * * * * * * * * * * *
which operator is known as dummy operator in c?
printf(), scanf() these are a) library functions b) userdefined functions c) system functions d) they are not functions
What is the difference between specifying a constant variable like with constant keyword and #define it? i.e what is the difference between CONSTANT FLOAT A=1.25 and #define A 1.25
What is volatile
WRITE A PROGRAM IN C TO MULTIPLY TWO 2-D ARRAYS
What is output of the following program ? main() { i = 1; printf("%d %d %d\n",i,i++,i++); }
the operator for exponencation is a.** b.^ c.% d.not available
What is a floating point in c?
what is available in C language but not in C++?
10 Answers CTS, TCS,
What is the advantage of using #define to declare a constant?
1 Answers Agilent, ZS Associates,