ProgrammingVery hard
int count = 0; for (char c = 'a'; c <= 'z'; c++) if (c != 'e' && c != 'i' && c != 'o' && c != 'u') count++; printf("%d", count); What is printed?
- A. 26
- B. 21
- C. 22
- D. 18
Correct answer: C. 22
There are 26 letters and four vowels e, i, o and u are skipped. The vowel a is still counted, so the result is 22.
More C Programming questions
- printf("%d", 3 > 2 ? 'Y' : 'N'); What is printed?
- char names[] = {"x", "yy", "zzz"}; printf("%zu", strlen(names[2])); What is printed?
- int a[4] = {4, 3, 2, 1}; int s = 0; for (int i = 0; i < 4; i++) s = s 10 + a[i]; printf("%d", s); What is printed?
- int i = 1; int s = 0; while (i <= 4) s += i++; printf("%d", s); What is printed?
- int n = 0; do { n += 2; } while (n < 7); printf("%d", n); What is printed?
- unsigned char c = 0; c -= 1; printf("%d", c); What is printed?