C Program to display the No. of Digits in an Entered Number
Submitted by Srikanth on Monday, 3 December 20073 Comments
This program displays the number of digits present in the number that is entered through the input.
#include<stdio.h>
#include<conio.h>
#include<conio.h>
void main()
{
unsigned long int num;
int i=0;
clrscr();
printf(“Enter the digit\n”);
scanf(“%lu”,&num);
while(num!=0)
{
num=num/10;
++i;
}
printf(“Length=%d”,i);
getch();
}
Related Posts
By using/following this site you agree to our Legal Disclaimer

I DON’T KNOW WHAT KIND OF COMPILER DO YOU HAVE, BUT DEV REPORTS 4 OR 5 5 MISTAKES. WHY IS THAT HAPPENING.
@osbama,
Basically when you copy the program and use in Dev C++, then do following things
1) use int main instead of void main
2) Remove clrscr();
3) Correct the qoutes (“”), where ever in the program, Dev C++ doesnot recognize them as a qoute.
and then you will have your programe working
Regards
TanzeelurRehman
and it can’t display more than 10…
example… you input “54654651651654″, and the program says “Length=10″
Leave your response!
I am the author and founder of GoHacking. You can read more about me or get in touch with me on Google+ or contact page.
EMAIL SECURITY »
What to Do When Your Email Account is Hacked?
How to Recover Hacked Email Accounts?
It can be a real nightmare if someone hacks and takes control of your email account as it may contain confidential information like bank logins, credit card details and other sensitive data. …
HOW STUFFS WORK »
How Antivirus Software Works
Due to ever increasing threat from virus and other malicious programs, almost every computer today comes with a pre-installed antivirus software on it. In fact, an antivirus has become one of the most essential software package for every computer. Even though every one …
HOW-TO GUIDES »
How to Retrieve Clipboard History in Windows
Ever copied a code snippet or text from the web and forgot to paste it before you copied something else? Well, all of us will have an experience of something like this, where we want to …
INTERNET SECURITY »
How to Hide Data in Image, Audio & Video Files: Steganography
Ever wondered to know how to hide secret messages in images, audio and video files? Well, in this post I will take you through a concept called steganography using which, it is possible to hide your secret information …
NETWORK HACKS »
Customize Google to Improve Search Results
Google is indisputedbly the best search engine out there on the Internet, however there are a few ways by which you can customize Google and make it even better. I have got 3 best free Firefox extensions using which you …
Categories
Most Popular
Most Commented
Blogroll
Log In | Entries (RSS) | Comments (RSS) | Sitemap
© 2008-2012 GoHacking.Com. This content is copyrighted to Srikanth and may not be reproduced on other websites.