65 789
Assignments Done
99,4%
Successfully Done
In October 2018

Answer to Question #13354 in Visual Basic for sakura

Question #13354
Create a program that will input a number and will count the number of digits.
Enter a number: 12345
Number of Digits: 5
Try again [y/n]?
Expert's answer
#include<stdio.h>
#include<conio.h>
#include <string>
#include <iostream>
using namespace std;
int main()
{
char ch=' ';
do{
unsigned long int num;
int numberofdigits=0;
printf("Enter a number: ");
scanf("%lu",&num);
while(num!=0)
{
num=num/10;
numberofdigits++;
}
printf("Number of Digits: %d",numberofdigits);
printf("
Try again [y/n]?
");
cin>>ch;
}while(ch!='n');
return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions