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..

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

Is it better to use a pointer to navigate an array of values, or is it better to use a subscripted array name?

646


How can I call system when parameters (filenames, etc.) Of the executed command arent known until run time?

583


What is string constants?

653


What is mean by Data Driven framework in QTP? Can any one answer me in details on this regard.

1779


Explain the use of #pragma exit?

690






Why cant I open a file by its explicit path?

589


Explain the use of fflush() function?

620


How can I call fortran?

636


What is the use of c language in real life?

525


What is a good way to implement complex numbers in c?

585


Why C language is a procedural language?

614


What is the 'named constructor idiom'?

633


Explain the meaning of keyword 'extern' in a function declaration.

711


Explain indirection?

637


What language is lisp written in?

609