Question: Writing Simple C program: (Problem Solving) a. Write a program in C that will ask user to input any year from keyboard and find out

Writing Simple C program: (Problem Solving) a. Write a program in C that will ask user to input any year from keyboard and find out whether it is a leap year or not. Then add the digits of the year and print the sum.

Sample input: 2004 Sample input: 1998 Sample output: Sample output: 2004 is a leap year 1998 is not a leap year Sum = 6 Sum = 27

b. Suppose you want to order a pizza from a restaurant. You have two options: a) you can order one n inch large pizza or b) two m inch small pizza. Now write a program in C that will take diameters of the pizzas as input and find out which option is more profitable by comparing the area of the pizza.

Sample input: 18 12

Sample output: Area of one 18 inch pizza= 254.34

Area of two 12 inch pizza= 226.08 One 18 inch pizza has more pizza!

c.

Write a C program that will take a series of 6 integers as input in an array. The program should find the max and min value of that series. Also find whether Max%Min results in an even number or odd number.

Sample input: 10 5 7 3 49 2

Sample output:

Max = 49

Min = 2

Odd

plz explained the c codes......

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!