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

Answers were Sorted based on User's Feedback



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

Answer / vaibhav

#include<stdio.h>
#include<conio.h>
void main()
{
int no,t,cnt=0;
clrscr();
printf("\n enter the no.");
scanf("%d",&no);
while(no!=0)
{
t=no%10;
no=no/10;
cnt++;
}
printf("\nTotal count of digit is%d",cnt);
getch();
}

Is This Answer Correct ?    19 Yes 4 No

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

Answer / 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

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

Answer / govind279

#include<stdio.h>
int main()
{
int n,m,sum=0;
scanf("%d",&n);
for(m=0;((m=n%10)!=0);n=(n/10))
sum+=m;
printf("count is %d\n",sum);
}

Is This Answer Correct ?    14 Yes 10 No

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

Answer / sashidharan

main()
{
int n,count=0;
scanf("%d",&n);
for(i=0;i<=n;i++)
{
count=count+1;
}
printf("total count of digit",count);
}

Is This Answer Correct ?    22 Yes 20 No

Post New Answer

More C Interview Questions

Where does the name "C" come from, anyway?

0 Answers   Celstream,


what is c language?

2 Answers  


What is the incorrect operator form following list(== , <> , >= , <=) and what is the reason for the answer?

0 Answers  


What are directives in c?

0 Answers  


Can we change the value of #define in c?

0 Answers  


How many main () function we can have in a project?

0 Answers  


1. Write the function int countchtr(char string[ ], int ch); which returns the number of times the character ch appears in the string. Example, the call countchtr(“She lives in NEWYORK”, ‘e’) would return 3.

4 Answers  


What are predefined functions in c?

0 Answers  


Explain the difference between the local variable and global variable in c?

0 Answers  


without a terminator how can we print a message in a printf () function.

7 Answers   NIIT,


How. To pass the entrance test

1 Answers   Tech Mahindra,


what is void pointer?

2 Answers  


Categories