int a = 7;
double b = a; // implicit: int -> double (safe)
double x = 3.99;
int y = (int)x; // C-style: 3 (truncates, not rounds)
int z = static_cast<int>(x); // C++ style — preferred
int votes = 7, total = 10;
// Wrong: 7 / 10 = 0 (integer division)
double pct = static_cast<double>(votes) / total * 100;
// pct == 70.0
char c = 'A';
int n = c; // 65 (ASCII)
cout << (char)(c+1); // 'B'
Write percentage(int part, int total) returning (part/total)*100 as a double.
Example: percentage(3, 4) → 75.0
Click "Run" to execute your code.