Answer:
a. Maximum size of file = 8.003 GB
Explanation:
<u>a. Maximum size of file</u>
= (6 * 2 KB) + (2048 * 2 KB) + (2048 * 2048 * 2 KB)
= 12kb + 4096 Kb + 8388608 kb
= 8392716 kb
8392716/1024 mb = 8196.01 MB
8196.01 /1024 GB= 8.003 GB
<u>b. According to above calculation</u>
For 8 GB 6 direct, 1 single and 1 double indirect block requires
so
for 32 GB
24 direct Block
4 single and 4 double indirect block requires
Answer:
Written using C++
/*Enter Your Details Here*/
#include<iostream>
#include<cmath>
using namespace std;
int main()
{
//1
float side;
cout<<"Enter the side of a square: ";
//2
cin>>side;
//3
float perimeter = 4 * side;
cout<<"The perimeter is "<<perimeter<<endl;
//4
float area = side *side;
cout<<"The area is "<<area<<endl;
//5
float diagonal = sqrt(2 * side * side);
cout<<"The length of the diagonal is "<<diagonal;
return 0;
}
Explanation:
<em>I've added the full source code as an attachment where I used more comments to </em><em>explain </em><em>difficult line</em>
The area of a square is simply the square of the side. So, you only need to write a program that receives a number as input, which is the side of the square, and returns that number squared, which will be the area of the square.
You didn't specify any language, so for example here's a C implementation that receives the side from the user and returns the area:
#include <stdio.h>
int main()
{
double side, area;
do{
printf("Enter the side of the square (must be >0): ");
scanf("%lf", &side);
} while(side<=0);
area = side * side;
printf("The area is %lf", area);
}