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 / aha na
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j,sum=0;
clrscr();
printf("\n enter a number",i);
scanf("%d",&i);
while(i<=0)
{
j=i%10;
sum=sum+j;
i=i/10;
}
printf("\n the sum of the digits
are:%d\n");
getch();
}
Is This Answer Correct ? | 14 Yes | 30 No |
Post New Answer View All Answers
What are identifiers in c?
1) write a program to generate 1st n fibonacci prime numbers using Nested if 2) write a program to generate twin prime numbers from m to n using nested if 3) write a program to check whether a given integer is a strong number or not using nested if 4) Write a program to generate prime factors of a given integer using nested if 5)write a program to generate prime numbers from m to n using nested if 6)write a program to generate perfect numbers from m to n using nested if 7)write a program to generate the pallindromes from m to n using neste if 8)write a program to generate armstrong numbers from m to n using nested if 9)write a program to generate strong numbers from m to n using nested if
Write a C program to accept a matrix of any size. Find the frequency count of each element in the matrix and positions in which they appear in the matrix
Why c is called free form language?
Can you please explain the difference between syntax vs logical error?
Why main is used in c?
differentiate built-in functions and user – defined functions.
i have to apply for rbi before that i need to know the the syllabus for the entrance questions. whethet it may be aps or techinical
Is c language still used?
Explain what is the purpose of "extern" keyword in a function declaration?
What is spark map function?
please explain every phase in the "SDLC" in the dotnet.
the number of measuring units from a arbitrary starting point in a record area or control block to some other point a) branching b) recording pointer c) none d) offset
Explain what is wrong with this program statement? Void = 10;
what is the differnce between programing langauge and tool? is sas is a programing langauge r tool?