Hey.
The task. Translate inches to cm. I enter 2i, should bring 5.08 cm.
#include <stdio.h> int main() { int x; char ch; ch = getchar(); scanf("%d%c", &x, &ch); //ch = getchar(); if (x == 2 && ch == 'i') printf("%lf cm\n", 2.54 * x); //2i = 5.08cm } Where is the mistake? I may not understand something, the check seems to be worth it.