aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ee2301/baseConvert.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/ee2301/baseConvert.cpp b/ee2301/baseConvert.cpp
index 486a68f..d675741 100644
--- a/ee2301/baseConvert.cpp
+++ b/ee2301/baseConvert.cpp
@@ -2,6 +2,7 @@
// to decimal
#include <stdio.h>
#include <string.h>
+#include <iostream>
// To return value of a char. For example, 2 is
// returned for '2'. 10 is returned for 'A', 11
@@ -47,7 +48,9 @@ int main()
{
char str[] = "11A";
int base = 16;
- printf("Decimal equivalent of %s in base %d is "
+ printf("Please enter number followed by base: ");
+ std::cin >> str >> base;
+ printf("Decimal equivalent of %s in base %d is"
" %d\n",
str, base, toDeci(str, base));
return 0;