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 / rajan praksh more (vangani-tha

#include<stdio.h>
#include<conio.h>
void main()
{
int rem,a;
int sum=0;
clrscr();
printf("Enter The Number: ");
scanf("%d",&a);
while(a>0)
{
rem=a%10;
sum=sum+rem;
a=a/10;
}
printf("sum of digits of entered number is =%d",sum);
getch();
}

Is This Answer Correct ?    0 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is c is a middle level language?

1126


When should structures be passed by values or by references?

1086


a program that can input number of records and can view it again the record

1964


What is the use of bitwise operator?

1175


How can I make sure that my program is the only one accessing a file?

1350


what do the 'c' and 'v' in argc and argv stand for?

1223


main() { inta=10,b=20; a>=5?b=100:b=200; printf("%d ",b); }

1650


What are the keywords in c?

1177


Explain enumerated types.

1088


In C language what is a 'dangling pointer'?

1242


Can you please explain the difference between malloc() and calloc() function?

1183


Why do we write return 0 in c?

1129


Why is this loop always executing once?

1110


Ow can I insert or delete a line (or record) in the middle of a file?

1050


hi any body pls give me company name interview conduct "c" language only

2323