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

wht is the difference between KPO and BPO ?

2 Answers   Accenture, BPO, HCK, HCL, Infosys,


#include <stdio.h> void main() { int i=-1,j=1,k,l; k=!i&&j; l=!i||j; printf ("%d%d",k,l) ; }

3 Answers   SRG,


What is a MAC Address?

0 Answers  


How we can set and clear bit in a byte using macro function?

2 Answers   L&T, Samsung,


Go through the following code sinippet char a[20]; a="Hello Orcale Test"; will this compile?

4 Answers   Oracle,






Define Array of pointers.

0 Answers  


Do you know the difference between malloc() and calloc() function?

0 Answers  


Why clrscr is used after variable declaration?

0 Answers  


How can draw a box in cprogram without using graphics.h header file & using only one printf(); ?

4 Answers   NIIT,


which header file contains main() function in c?

17 Answers   Google, HCL, TCS,


what is calloc and malloc?

2 Answers  


sqrt(x+sqrt(x+sqrt(x+sqrt(x))))=2; Find the value of x?

4 Answers   Subex,


Categories