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

write a 'c' program to sum the number of integer values

Answer Posted / ruchi

#include<stdio.h>
#include<conio.h>
int main()
{
int n,m,m1,s=0,d,sum;
printf("\nEnter the number ");
scanf("%d",&n);
m=n%10;
d=n/10;
while(d>=10)
{
m1=d%10;
d=d/10;
s =s+m1;
}
sum=s+m+d;
printf("\nSum is %d",sum);
getch();
}

Is This Answer Correct ?    4 Yes 15 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Describe the steps to insert data into a singly linked list.

1067


What happens if you free a pointer twice?

1064


How does normalization of huge pointer works?

1165


How to declare pointer variables?

1231


What are c preprocessors?

1183


Explain high-order bytes.

1105


What is nested structure with example?

1067


what are the different storage classes in c?

1177


Linked lists -- can you tell me how to check whether a linked list is circular?

1077


Why do we write return 0 in c?

1046


Write a C Program That Will Count The Number Of Even And Odd Integers In A Set using while loop

2147


Why is c called a mid-level programming language?

1195


What is pointer to pointer in c with example?

1058


What are static variables in c?

1075


Why shouldn’t I start variable names with underscores?

1056