





Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!






return_type function_name( arg_type arg_1, arg_type arg_2, ...) { Declare variables used inside the function that are not arguments (multiple lines ) Executable statements ( could call other functions ) multiple lines return value (if function has a return value) }
if ( logical expression ) executable statement;
if ( logical expression ) { executable statement; executable statement; }
if ( logical expression ) { executable statement; executable statement; } else if ( logical expression ) { executable statement; executable statement; } else { executable statement; executable statement; }
#include <stdio.h> #include <stdlib.h>
int main() { int day, month, year;
printf("Enter the month > "); scanf("%d", &month);
// Check to see if this is a valid month if( ) {
printf("%d is an invalid month!\n"); exit(0); }
// More code.
return 0; }
Write a valid condition to check to see if the input month is valid or not.