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

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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is local and global variable in c?

610


Why are algorithms important in c program?

610


List some of the dynamic data structures in C?

777


Can we assign integer value to char in c?

608


Explain how do you use a pointer to a function?

634






Explain 'bit masking'?

640


a way in which a pointer stores the address of a pointer which stores the value of the target value a) reference b) allocation c) multiple indirection d) none

620


what is bit rate & baud rate? plz give wave forms

1508


The postoder traversal is 7,14,3,55,22,5,17 Then ur Inorder traversal is??? please help me on this

2916


How macro execution is faster than function ?

656


How important is structure in life?

580


What should malloc() do?

634


What is the use of header files?

590


hi to every one .. how to view table pool after creating the pooled table? plz help me.. if any knows abt this ..

1456


Can we change the value of constant variable in c?

566