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


Please Help Members By Posting Answers For Below Questions

What is the use of sizeof?

1013


in linking some of os executables are linking name some of them

2126


Where static variables are stored in c?

1105


What is a far pointer in c?

1039


When I set a float variable to, say, 3.1, why is printf printing it as 3.0999999?

1063


Should I learn c before c++?

1226


What is the easiest sorting method to use?

1158


What is the incorrect operator form following list(== , <> , >= , <=) and what is the reason for the answer?

1458


Which is more efficient, a switch statement or an if else chain?

1019


How do we print only part of a string in c?

1020


What is difference between stdio h and conio h?

1367


Can the size of an array be declared at runtime?

1080


Explain pointers in c programming?

1107


regarding pointers concept

2034


Write a program on swapping (100, 50)

1117