Multiple choice

What will be the output of the following program if 'n' key is pressed after execution of program? #include<stdio.h> #include<process.h> void main() {char ch; printf("enter Y/y to continue"); scanf("%c",&ch); if(ch=='y' || ch=='Y') printf("Yes"); else exit(1); }

Consider the letters written like A, B, C, V are the keys prssed by user. User can press any key, we have considered following keys has been prssed.

  1. Yes

  2. Exit from program

  3. Error: exit function should have prototype

  4. No

  5. None of these

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

As input to program is 'n'i.e. other than Y,y, it will exit from program