3. Write a program to find and print areas of rectangle.
Answers
Answer:
in which language?
i am writing in C, PHP, JAVA, C#, PYTHON
Explanation:
IN C LANGUAGE:
#include <stdio.h>
int main()
{
int width=5;
int height=10;
int area=width*height;
printf("Area of the rectangle=%d",area);
}
IN PHP LANGUAGE:
<?php
$width=5;
$height=10;
$area=$width*$height;
echo "Area of the rectangle=";
echo $area;
?>
IN JAVA LANGUAGE:
public class rectangle{
public static void main(String args[])
{
int width=5;
int height=10;
int area=width*height;
System.out.println("Area of rectangle="+area);
}
}
IN C# LANGUAGE:using System;
public class Program
{
public static void Main()
{
int width=5;
int height=10;
int area=width*height;
Console.WriteLine("Area of rectangle="+area);
}
}
IN PHYTHON LANGUAGE:
width=5
height=10
area=width*height
print("Area of rectangle="+str(area))
THIS MAY BE CORRECT.