Programming for Problem Solving

GTU Practical 9

9. Write a program to read marks of a student from the keyboard whether the student is pass or fails ( using if-else)
#include<stdio.h>  ( this applies in the given code )

#include

int main() {
int marks;
printf(“Enter your marks: “);
scanf(“%d”, &marks);
printf(marks < 23 ? "\nSorry ..! You are Fail" : "\nCongratulation …! You are Pass"); return 0; }

OUTPUT

Enter your marks: 33

Congratulation …! You are Pass

GTU STUDY