Monday, July 2, 2012

Digit to Number

Assalamu Alaikum. Hope you all are well by the grace of Almighty. Today we learn how to make an integer number from some digits.Take a look at the problems.

Problem 1: Write a program that takes digits from the user until a negative digit. When an user puts  negative digits it shows the integer number which is combined by those digits.

Sample Input:

1
5
6
0
-2

Sample Output:

1560

Solution:




Problem 2: Write a program that takes the digits from the user until End of File. Then it shows the integer number which is combined by those digits.

Sample Input:

1
5
6
^Z

Sample Output:

156

Solution:



To End the input we have to press ctrl + Z.
Thank you all..:)

0 comments:

Post a Comment