how can I transfer this 2 codes into cin,cout instead of scan,print
I need your help please
Char X;
float w ,l ,b , h , r ;
const float pi = 3.14;
Scanf("%c",X)
if (X==R) {scanf("%f,%f" w,l)
printf("%f" (w*l)
}
if (X==T){scanf("%f,%f" b,h)
printf("%f" (0.5*b*h)
}
if (X==C) {scanf("%f" r)
printf("%f" pow(r,2)*pi)
}
else printf("please enter R || T || C")
///////////////////////////////////////////
Char X;
float w ,l ,b , h , r ;
const float pi = 3.14;
Scanf("%c",X)
Switch(X)
Case R: {scanf("%d,%d" w,l)
printf("%f" (w*l)
}
Case T: {scanf("%f,%f" b,h)
printf("%f" (0.5*b*h)
}
Case C: {scanf("%f" r)
printf("%f" pow(r,2)*pi)
}
else printf("please enter R || T || C")