diff options
author | RossTheRoss <msattr@gmail.com> | 2019-10-15 10:43:42 -0500 |
---|---|---|
committer | RossTheRoss <msattr@gmail.com> | 2019-10-15 10:43:42 -0500 |
commit | 7783b6106088e6b42b6c672d2924636d30d1588b (patch) | |
tree | 5510588529102cdf0710f26e5339ba3b1f673f2f | |
parent | Funstuff (diff) | |
download | homework-7783b6106088e6b42b6c672d2924636d30d1588b.tar homework-7783b6106088e6b42b6c672d2924636d30d1588b.tar.gz homework-7783b6106088e6b42b6c672d2924636d30d1588b.tar.bz2 homework-7783b6106088e6b42b6c672d2924636d30d1588b.tar.lz homework-7783b6106088e6b42b6c672d2924636d30d1588b.tar.xz homework-7783b6106088e6b42b6c672d2924636d30d1588b.tar.zst homework-7783b6106088e6b42b6c672d2924636d30d1588b.zip |
I should probably pay attention
Diffstat (limited to '')
-rw-r--r-- | ee2301/baseConvert.cpp | 5 |
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; |