Monday, October 14, 2019

                                      E-BOX    

                                 BASICS OF C PROGRAMMING   

I/O Statements,Operators And Expressions :-  I - Design

PROGRAM -14 :

 PROBLEM

S1P14-FOOD FESTIVAL AT HILLTOWN

Food Festival at HillTown

HillTown Inn is planning to organize a Food Festival bringing together at one place, a wide variety of cuisines from across the world on account of Christmas. The Hotel Management has rented out a square hall of an indoor Auditorium for this extravaganza. The side of the square hall is y  inches in which a large square table is placed for the display of the most popular and celebrated food items. The side of the square table is x  inches, such that x<y.
 
The Management wanted to fill the remaining floor area with a decorative carpet. To get this done, they needed to know the floor area to be filled with the carpet. Write a program to help the Management find the area of the region located outside the square table, but inside the square hall.
 
Input Format:

First line of the input is an integer y, the side of the square hall.
Second line of the input is an integer x, the side of the square table placed for display.
 
Output Format:

Output should display the area of the floor that is to be decorated with the carpet.
Refer sample input and output for formatting specifications.
[All text in bold corresponds to input and rest corresponds to output.]

Sample Input and Output 1:

Enter the side of the square hall
7
Enter the side of the square table placed for display
3
Area to be decorated is 40

Sample Input and Output 2:
Enter the side of the square hall
5
Enter the side of the square table placed for display
2
Area to be decorated is 21



SOLUTION :

No comments:

Post a Comment

                                                 E-BOX                                                     BASICS OF C PROGRAMMING       i -...

https://amzn.to/2LAmadv