7 #include #include using namespace std; int val (char c) 11 E { 8 9 10 if (c >= '0' && c = 'A' && c = @; i--) { if (val(str[i]) >= base) { printf("Invalid Number"); return -1; } num +=val(str[i]) *...


What is this programming language?  C or C++


7<br>#include <iostream><br>#include <string.h><br>using namespace std;<br>int val (char c)<br>11 E {<br>8<br>9<br>10<br>if (c >= '0' && c <= '9')<br>return (int)c - '0';<br>else if (c >= 'A' && c <= 'z')<br>return (int)c - 'A' + 10;<br>12<br>13<br>14<br>15<br>16<br>else<br>return (int)c - 'a' + 10;<br>17<br>18<br>int toDeci(char *str, int base)<br>20 E {<br>19<br>int len =0;<br>while(str[len]!= '\0') {len++;}<br>int power = 1;<br>int num = e;<br>int i;<br>21<br>22<br>23<br>24<br>25<br>for (i = len - 1; i >= @; i--)<br>{<br>if (val(str[i]) >= base)<br>{<br>printf(>numbers[i]; } cout<"number in="" 14th="" base="" \tcorresponding="" decimal="" number\n";="" for="" (int="" i=""><5;i++){><><>
Extracted text: 7 #include #include using namespace std; int val (char c) 11 E { 8 9 10 if (c >= '0' && c <= '9')="" return="" (int)c="" -="" '0';="" else="" if="" (c="">= 'A' && c <= 'z')="" return="" (int)c="" -="" 'a'="" +="" 10;="" 12="" 13="" 14="" 15="" 16="" else="" return="" (int)c="" -="" 'a'="" +="" 10;="" 17="" 18="" int="" todeci(char="" *str,="" int="" base)="" 20="" e="" {="" 19="" int="" len="0;" while(str[len]!='\0' )="" {len++;}="" int="" power="1;" int="" num="e;" int="" i;="" 21="" 22="" 23="" 24="" 25="" for="" (i="len" -="" 1;="" i="">= @; i--) { if (val(str[i]) >= base) { printf("Invalid Number"); return -1; } num +=val(str[i]) * power; power = power * base; 26 27 28 29 30 31 32 33 34 return num; } int main () 39 E { 37 38 char numbers[5][18]; cout<"enter five="" numbers="" in="" base="" 14="" below\n";="" for="" (int="" i=""><5;i++){><"enter number=""><>numbers[i]; } cout<"number in="" 14th="" base="" \tcorresponding="" decimal="" number\n";="" for="" (int="" i=""><5;i++){><><>

Jun 11, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here