Answer Posted / deepak upadhyay
#include<stdio.h>
void main()
{
int num,a,b,c,d,e,sum;
printf("enter the num");
scanf("%d",&num);
a=num%10;
b=((num%100)-a)/10;
c=((num%1000)-(num%100))/100;
d=((num%10000)-(num%1000))/1000;
e=((num%100000)-(num%10000))/10000;
sum=a+b+c+d+e;
printf("\n1's place= %d \n10's place= %d \n100's
place= %d \n1000's place= %d \n10000's place=
%d",a,b,c,d,e);
printf("\nsum=%d",sum);
}
| Is This Answer Correct ? | 1 Yes | 6 No |
Post New Answer View All Answers
hi friends how r u as soon in satyam my interview is start but i m very confusued ta wat i do plz help me frndz wat can i do plz tell me some question and answers related with "C" which r asked in the interview .
What is variable declaration and definition in c?
What do header files do?
An organised method of depicting the use of an area of computer memory used to signify the uses for different parts of the memory a) swap b) extended memory c) memory map d) all of the above
What is pass by value in c?
What is a floating point in c?
What is the -> in c?
a program that can input number of records and can view it again the record
Explain Function Pointer?
What is main function in c?
Explain heap and queue.
What are multidimensional arrays?
a linearly ordered set of data elements that have the same structure and whose order is preserved in storage by using sequential allocation a) circular b) ordinary c) array d) linear list
What are static variables in c?
Find MAXIMUM of three distinct integers using a single C statement