if a five digit number is input through the keyboard, write
a program to calculate the sum of its digits.
(hint:-use the modulus operator.'%')
Answer Posted / rajrartan singh
#include<stdio.h>
#include<conio.h>
void main();
{
int n,d1,d2,d3,d4,d5,sum;
ptintf("enter the five digit no.");
scanf("d",&n);
s=d1+d2+d3+d4+d5;
getch();
}
| Is This Answer Correct ? | 4 Yes | 10 No |
Post New Answer View All Answers
Explain how does free() know explain how much memory to release?
The program will first compute the tax you owe based on your income. User is prompted to enter income. Program will compute the total amount of tax owed based on the following: Income Tax 0 - $45,000 = 0.15 x income $45,001 - $90,000 = 6750 + 0.20 x (income – 45000) $90,001 - $140,000 = 15750 + 0.26 x (income – 90000) $140,001 - $200,000 = 28750 + 0.29 x (income – 140000) Greater than $200,000 = 46150 + 0.33 x (income – 200000) Dollar amounts should be in dollars and cents (float point numbers with two decimals shown). Tax is displayed on the screen.
int i[2], j; int *pi;i[0] = 1; i[1] = 5; pi = i; j = *pi + 1 + *(pi + 1)Value of j after execution of the above statements will be a) 7 b) 6 c) 4 d) pointer
What do you know about the use of bit field?
write a program to display all prime numbers
What does %p mean?
Linked lists -- can you tell me how to check whether a linked list is circular?
How do we make a global variable accessible across files? Explain the extern keyword?
What is ponter?
how can use subset in c program and give more example
What is the difference between #include
What is the use of parallelize in spark?
What is the package for freshers(Non IIT) in amazon(hyderabad). And what is the same for those who are a contract employee.
how to make a scientific calculater ?
Explain how do you override a defined macro?