24 Computer -- Programming Concepts and Logics

WAP to input day of a week and print “Holiday” if it is Saturday.

WAP to input day of a week and print “Holiday” if it is Saturday.

The following is a C program to  input day of a week and print “Holiday” if it is Saturday.


#include <stdio.h>

#include <string.h>
void main() { int week; /* Input week from user */ printf("Enter the day of the week: "); scanf("%d", &a);

        char b[8] = "saturday";

if(strcmp(a,b) == 0) { printf("Holiday!!"); }

getch();

}




More questions on Programming Concepts and Logics

Close Open App