Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Classwork_1: Write a C program to input number from user and check whether the number is even or odd using switch case. How to check

image text in transcribedimage text in transcribedimage text in transcribed

Classwork_1: Write a C program to input number from user and check whether the number is even or odd using switch case. How to check even or odd using switch case in C programming. Logic to check whether a number is even or odd using switch case in C program. Example: Input Input number: 12 Output Even number Write the c program below and run it in DEV C: Output: #include int main() { int num; printf("Enter a positive integer number: "); scanf("%d", &num); switch (num %2) { case : printf("%d is an even number. ", num); break; case 1: printf("%d is an odd number. ", num); break; } return 0; } Classwork_2 simple calculator: Write a C program to display a menu and ask the user to choose one option from the menu. This program should ask the user to input two numbers and depending on his choice either add, subtract, multiply or divide these two number. Example: Input Please input your first number: Please input your second number: Menu Please choose one of the following options 1- To add the numbers 2- To multiply the numbers 3- To subtract the first-second 4- To divide the first / second Your choice is: Output You have chosen to ---, therefore the result is: Write the c program below and run it in DEV C: Output: Classwork_3 Number of days is a month: Write a C program to input month number and print total number of days in month using switch...case. C program to find total number of days in a month using switch...case. Logic to print number of days in a month using switch...case in C programming. Example: Input Input your month: 1 Output The number of days in this month is: 31 days Write the c program below and run it in DEV C: Output

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Security XI Status And Prospects

Authors: T.Y. Lin, Shelly Qian

1st Edition

0412820900, 978-0412820908

More Books

Students also viewed these Databases questions