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

wap in c to accept a number display the total count of digit

Answer Posted / santhi perumal

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

int main()
{
int number,m,sum =0,count =0;

printf("Enter the number \n");
scanf("%d",&number);

while(number != 0)
{
m = number % 10;
sum = sum + m;
count++;
number = number / 10;
}

printf("\nThe number of Digits in the Given Number is
%d\n",count);
printf("The Sum of Digits in the Given Number is %d\n",sum);



}

Is This Answer Correct ?    19 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the advantages of union?

1059


What is the explanation for the dangling pointer in c?

1099


i want to know the procedure of qualcomm for getting a job through offcampus

2450


Dont ansi function prototypes render lint obsolete?

1111


What is a #include preprocessor?

1126


Program to find the sum of digits of a given number until the sum becomes a single digit. (e.g. 12345=>1+2+3+4+5=15=>1+5=6)

1136


the maximum length of a character constant can be a) 1 character b) 8 characters c) 256 chaacters d) 125 characters

2285


What is || operator and how does it function in a program?

1069


string reverse using recursion

2441


What is array of structure in c programming?

1276


please send me the code for multiplying sparse matrix using c

2153


What are the advantages of using new operator as compared to the function malloc ()?

1316


What is the hardest programming language?

1130


why we wont use '&' sing in aceesing the string using scanf

2355


What is return in c programming?

958