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

how to find sum of digits in C?

Answer Posted / sarthak patwal

#include <stdio.h>
#include <conio.h>

void main()
{
clrscr();
int a,b,c,d;
printf ("Enter the number");
scanf ("%d",a);
b=a%10;
c=a/10;
d=b+c;
printf ("The sum of digits is %d",d);
getch();
}

Is This Answer Correct ?    1 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Write a program to reverse a string.

1086


What is c mainly used for?

1076


How can I find out the size of a file, prior to reading it in?

1184


What are 3 types of structures?

1072


What is the use of function in c?

1199


What is a macro in c preprocessor?

1108


What will be the outcome of the following conditional statement if the value of variable s is 10?

1302


What are the advantages of c preprocessor?

1269


what is reason of your company position's in india no. 1.

2346


What is exit() function?

1030


Can a pointer be static?

1091


how logic is used

1980


What is storage class?

1086


Can the curly brackets { } be used to enclose a single line of code?

1177


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

1071