Grade 6 Programs
1. Program to find the area of a rectangle #include <stdio.h> // Header file for input and output functions int main() { float length, breadth, area; // Variables to store length, breadth, and area // Asking the user to enter length and breadth printf("Enter the length of the rectangle: "); scanf("%f", &length); printf("Enter the breadth of the rectangle: "); scanf("%f", &breadth); // Formula for area of rectangle = length * breadth area = length * breadth; // Displaying the result printf("Area of the rectangle = %.2f\n", area); return 0; // End of program } 2. Program to find the area of a triangle #include <stdio.h> int main() { float base, height, area; // Asking the user for base and height printf("Enter the base of the triangle: "); scanf("%f", &base); printf("Enter the height of the triangle: "); ...