write a program in c to find out the sum of digits of a
number.but here is a condition that compiler sums the value
from left to right....not right to left..



write a program in c to find out the sum of digits of a number.but here is a condition that compile..

Answer / sorab aggarwal

#include<conio.h>
#include<stdio.h>
void main()
{
int a,b,c,d,e;
a=10;
b=20;
c=30;
d=40;
e=(((a+b)+c)+d);
printf("the sum of no. is ::",e);
}

Is This Answer Correct ?    1 Yes 1 No

Post New Answer

More C Interview Questions

why array index always starts from zero??

4 Answers   TCS,


how can i get the output 54321 4321 321 21 1 in c programming........???? pls help......

10 Answers   Infosys,


any string of bits of length 'n' represents a unique non- negative integer between.............?

2 Answers  


what will be the output of the following program, justify? #define TEST int TEST getdata() { static i; i+=10; return i; } main() { int k; k = getdata(); }

3 Answers  


Multiply an Integer Number by 2 Without Using Multiplication Operator

0 Answers  






What is c programing language?

0 Answers  


Hai sir, I had planned to write the NIC scientific engineer exam , plz post the sample question......

0 Answers  


What is the difference between null pointer and wild pointer?

0 Answers  


What are shell structures used for?

0 Answers  


write a c program for print your name .but,your name may be small letter mean print a capital letter or your name may be capital letter mean print a small letter .example \\enter ur name : sankar The name is: SANKAR (or) enter your name:SAnkar The name is:saNKAR

5 Answers  


What language is windows 1.0 written?

0 Answers  


Write code for atoi(x) where x is hexadecimal string.

5 Answers   Adobe,


Categories