I have written a simple c++ program on visual studio to convert number from any base to decimal.
The program compiles but doesnt show output on the console.
Even after taking inputs through cin, consle is just open blinking but nothing happens thereafter
Source code:
#include <iostream>
using namespace std;
void main()
{
int Base = 3; int Number = 122;
int j = 0;
int dec = 0;
int num = Number;
while (num >= 0)
{
dec += (num % 10)* (Base^j);
num = num / 10;
j++;
}
cout << "Decimal is" << dec;
}