Examveda
Examveda

Determine Output:
void main()
{
      int i;
      char a[]="�"; 
      if(printf("%sn", a))
            printf("Ok here n");
      else
            printf("Forget itn");
}

A. Ok here

B. Forget it

C. Error

D. None of These

Answer: Option A

Solution(By Examveda Team)

Printf will return how many characters does it print. Hence printing a null character returns 1 which makes the if statement true, thus "Ok here" is printed.


This Question Belongs to C Program >> C Miscellaneous

Join The Discussion

Comments ( 1 )

  1. Vishal Garg
    Vishal Garg :
    8 years ago

    This is Correct Answer: �nOk here n

    Please Correct!

Related Questions on C Miscellaneous