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
How can I write functions that take a variable number of arguments?
Do you know the use of 'auto' keyword?
What is difference between array and pointer in c?
What is difference between union All statement and Union?
What is the right way to use errno?
What is c definition?
Explain which function in c can be used to append a string to another string?
Give me the code of in-order recursive and non-recursive.
Is c is a procedural language?
What is a class c rental property?
What do the functions atoi(), itoa() and gcvt() do?
main(){char *str;scanf("%s",str);printf("%s",str); }The error in the above program is: a) Variable 'str' is not initialised b) Format control for a string is not %s c) Parameter to scanf is passed by value. It should be an address d) none
What are the basic data types associated with c?
What is define directive?
Hi can anyone tell what is a start up code?