Question: Solve in C language. Only C language can be used. The loops we can use are : for if...else do...while switch.. if else.... nested for...

 Solve in C language. Only C language can be used. The

Solve in C language. Only C language can be used. The loops we can use are : for if...else do...while

switch.. if else.... nested for... nested if array

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 output: 2004 is a leap year Sum= 6 Sample input: 1998 Sample output: 1998 is not a leap year 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! Writing Simple C program: a. 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 b. Write a C program that will take a series of n integers as input in an array and sort the series in both ascending and descending order. Sample input: 5 10 15 45 5 0 Sample output: Ascending Order: 0 5 10 15 45 Descending Order: 45 15 10 5 0

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!