🎴 Flashcard Mode

C Programming

Card1 / 11
Mastered0
Review0
QuestionClick to flip

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.

AnswerClick to flip back
A
Exit from program
💡 Explanation:

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

Change Mode