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();
}
Popularity: 1% [?]
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!
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 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 …
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 »
How to Hack an Ethernet ADSL Router
Almost half of the Internet users across the globe use ADSL routers/modems to connect to the Internet however, most of them are unaware of the fact that it has a serious vulnerability which can easily be exploited even by a …
Categories
Most Popular
Most Commented
Blogroll
Log In | Entries (RSS) | Comments (RSS) | Sitemap
© 2008-2011 GoHacking.Com. This content is copyrighted to Srikanth and may not be reproduced on other websites.