Question: Write a C program that defines the length and breadth of a rectangle and calculates its area and perimeter. Area = Length * Breadth, Perimeter

Write a C program that defines the length and breadth of a rectangle and calculates its area and perimeter. Area = Length * Breadth, Perimeter = 2 * (Length + Breadth) a) Define a variable called "length", and sets its value to 10 b) Define a variable called "breadth", and sets its value to 5 c) Compute the area of the rectangle, and store it in a variable called "area" d) Compute the perimeter of the rectangle, and store it in a variable called "perimeter". e) Print the area and perimeter of your rectangle using the following printf statement: printf("Area = %d; Perimeter = %d", area, perimeter);

Then

Write a C program to take an integer input from the user (using scanf) and print the integer entered by the user in decimal, octal and hexadecimal format. Example Output 1: Enter an integer: 20 User Entered(decimal): 20 User Entered(octal): 24 User Entered(hexadecimal): 14 Example Output 2: Enter an integer: 500 User Entered(decimal): 500 User Entered(octal): 764 User Entered(hexadecimal): 1f4 Note: In this case, when asked/prompted to enter an integer, the user entered 20 and 500 respectively.

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!