Write the program form Armstrong no in c++?
Answers were Sorted based on User's Feedback
Answer / ankit,rohit
#include<stdio.h>
#include<conio.h>
void main()
{
int sum=0,n,m,i;
clrscr();
scanf("%d",&i);
n=i;
m=n;
while(n>0)
{
m=n%10;
sum=sum+(m*m*m);
n=n/10;
}
if(i==sum)
{
printf("the given number is amstrong");
else
printf("the given number is not amstrong");
}
getch();
}
Is This Answer Correct ? | 20 Yes | 22 No |
Given an array of size N in which every number is between 1 and N, determine if there are any duplicates in it. You are allowed to destroy the array if you like. [ I ended up giving about 4 or 5 different solutions for this, each supposedly better than the others ].
Comment on local and global scope of a variable.
Explain how to initialize a const member data.
Differentiate between an external iterator and an internal iterator?
what is difference between static and non-static variables
Evaluate the following expression as C++ would do :8 * 9 + 2 * 5 a) 82 b) 79 c) 370 d) list
What is stl containers in c++?
What are the types of array in c++?
When to use Multiple Inheritance?
What is the difference between the compiler and the preprocessor?
what is multi-threading in C++?
Evaulate: 22%5 a) 2 b) 4 c) 0