Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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 / jegadeesh

#include<stdio.h>
#include<conio.h>
void main()
{
int i,j;
scanf("%d",&i);
if((i%9)==0)
printf("The sum of digit is 9");
else
{
j=i%9;
printf("%d",j);
}
}

Is This Answer Correct ?    29 Yes 33 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why do we use pointer to pointer in c?

1082


Differentiate between new and malloc(), delete and free() ?

1181


What is c basic?

1166


What are the preprocessor categories?

1057


in multiple branching construct "default" case is a) optional b) compulsarily c) it is not include in this construct d) none of the above

1050


Here is a neat trick for checking whether two strings are equal

1017


what is event driven software and what is procedural driven software?

2566


What is maximum size of array in c?

1036


What is a rvalue?

1201


Why is c so important?

1060


List the difference between a 'copy constructor' and a 'assignment operator' in C?

1087


Write a C++ program to generate 10 integer numbers between - 1000 and 1000, then store the summation of the odd positive numbers in variable call it sum_pos, then find the maximum digit in this variable regardless of its digits length.

1999


How a string is stored in c?

1065


How reliable are floating-point comparisons?

1093


Which is better pointer or array?

1023