
Question
Scan a number along with its base value. If a number starts with 0, it indicates an octal value. If a number starts with 0x it indicates that the number is a Hexadecimal value. Print the Corresponding Decimal value.
Sample TestCase Expected Output
1. 0xA10
2. 01715
Answer
#include <stdio.h>
int main(){ int num; scanf("%i",&num); printf("%d",num); return 0;}
This comment has been removed by a blog administrator.
ReplyDelete