Single Choice Easy

QWhat is the output of this code?

#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("ATNYLA\n");
 }

ID: #887 Data Types in C Language 2,107 views
Question Info
#887Q ID
EasyDifficulty
Data Types in C LanguageTopic

Choose the Best Option

Click any option to instantly check if you're correct.

  • A Program will compile and print the output ATNYLA
  • B Program will compile and print ATNYLA for 5 times
  • C Program will compile and print the ASCII value of ATNYLA
  • D The compiler will flag an error
Correct Answer

Explanation

Output:


ATNYLA
ATNYLA
ATNYLA
ATNYLA
ATNYLA

Share This Question

Challenge a friend or share with your study group.