answersLogoWhite

0

#include<iostream>

#include<conio.h>

#include<string>

int main()

{

std::cout << "Enter your 10 digit code: ";

size_t code=0;

size_t len=0;

while (len<10)

{

char c = (char) _getch();

if (c=='0' && !code) // leading zero not permitted!

continue;

if (c>='0' && c<='9')

{

++len;

std::cout << c;

c -= '0';

code *= 10;

code += c;

}

}

std::cout << "\n\nYou entered: " << code << '\n' << std::endl;

}

User Avatar

Wiki User

10y ago

What else can I help you with?

Related Questions

Which numbers are integers?

All number accept 0, SCROLL DOWN


Writes a c program to find the sum of all integers between 1 and n?

Write a program to find the number and sum of all integers from 100 to 300 that are divisible by 11


Write a c program to accept a numbers and generate square root cube and exponential values?

write a c program to accept a number and generate a square root cube and exponential values


A c program for multiplication of two integers a and b?

/*PROGRAM TO ACCEPT TWO NUMBERS FROM THE USER AND PRINT THEIR MULTIPLICATION. */ #include&lt;stdio.h&gt; #include&lt;conio.h&gt; void main() { int a, b, c; // Declaration of Variables. Variables 'a' &amp; 'b' to hold first &amp; second number. And 'c' to hold result. clrscr(); // To clear the output screen every time program is executed. printf("\n Enter the first number : "); scanf("%d", &amp;a); // To accept the first number. printf("\n Enter the second number : "); scanf("%d", &amp;b); // To accept the second number. c = a*b; // Logic to get the product of the entered two numbers. printf("\n Multiplication of %d &amp; %d = %d", a, b, c); // Displaying result. getch(); // To hold the output screen. }


Write a statementin a java program to read 2 integers and dispay the number of interagers between them?

a=153 a=n%10;


What is integers on a number line?

Integers on the number line are the whole numbers.


What is the smallest number that can be divisible by all integers?

There does not exist a number that is divisible by all integers. The opposite is true. The number one can divided into all integers.


What are the nonpositive integers?

They are the number 0 and negative integers.


Where are the integers on a number line?

If you have drawn a number line counting in whole numbers, the integers are those whole number points. Any decimal numbers in between are not integers.


Is -23 a whole number or a integers?

It is a whole number and an integer but, since it is only one number, it cannot be "a integers"!


How do you find the sum of all the positive integers of a number?

By adding whatever you mean with "integers of a number".


What is negative integers number?

integers are basically any whole number, a negative integer is a negative whole number...such as -12