Aspire Faculty ID #13653 · Topic: JAMIA MILLIA ISLAMIA MCA 2023 · Just now
JAMIA MILLIA ISLAMIA MCA 2023

How will this call assign values when the user input is `29␠w` (a space between 29 and w)? scanf("%i%c", &i, &c);

Solution

Solution: `%i` reads an integer and **skips leading whitespace**, so it consumes `29`. `%c` reads the **next character exactly as-is** (does **not** skip whitespace). The next character after `29` is the space. Therefore: $i=29$, $c=$ space `' '`.

Previous 10 Questions — JAMIA MILLIA ISLAMIA MCA 2023

Nearest first

Next 10 Questions — JAMIA MILLIA ISLAMIA MCA 2023

Ascending by ID
Ask Your Question or Put Your Review.

loading...