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

What are identifiers c?

1020


What is #define size in c?

1118


What is difference between static and global variable in c?

980


Is c procedural or functional?

979


How do I send escape sequences to control a terminal or other device?

1014


Explain what will the preprocessor do for a program?

1005


What is the difference between union and anonymous union?

1249


Why dont c comments nest?

1000


What is the behavioral difference when include header file in double quotes (“”) and angular braces (<>)?

1272


Why is structure padding done in c?

1071


What's the difference between constant char *p and char * constant p?

1089


A float occupies 4 bytes in memory. How many bits are used to store exponent part? since we can have up to 38 number for exponent so 2 ki power 6 6, 6 bits will be used. If 6 bits are used why do not we have up to 64 numbers in exponent?

2257


What is union and structure?

1040


why return type of main is not necessary in linux

2043


What is a structure and why it is used?

1135