Quiz
C program with char cast: output of int array loop
Fragen in diesem Quiz (1)
1#include <stdio.h>
int main()
{
int a[5] = {1, 2, 3, 4, 5};
int i;
for (i = 0; i < 5; i++)
if ((char)a[i] == '5')
printf("%d\n", a[i]);
else
printf("FAIL\n");
}
- AThe compiler will flag an error
- BThe program will compile and print the output 5
- CThe program will compile and print the ASCII value of 5
- DThe program will compile and print FAIL for 5 times
Informationen
- Beschreibung
- Quiz am Ohne Titel, erstellt von Ahmed El-Dawy am 20/03/2020.
- Autor
- Ahmed El-Dawy
- Sprache
- English
- Aufrufe
- 0
- Bewertung
- Noch keine Bewertungen Bewerte dieses Quiz
Mehr zu Data Types, Variables and Operators