dimanche 25 avril 2021

How to change the output pattern? [closed]

//#include "stdafx.h"
#include <iostream>
using namespace std;
float r1;
float r2;
float area1;
float area2;
float redarea;
#define pi 3.142


int main()
    {
    cout << "Insert value of radius 1" << endl;
    cin >> r1;
    cout << "Insert value of radius 2" << endl;
    cin >> r2;
    area1 = pi * r1 * r1;
    area2 = pi * r2 * r2;
    redarea = area1 - area2;
    cout << "Area of red shaded region" << endl;
    cout << redarea;

    return 0;

    }

Hey guys I have a question about C++. Here I have done a code for the Lab Activity 2 coding but when Lab activity 3 need me to change the output pattern into a specific pattern, may I know how to change it and the solution about it. Here I will attach my original coding for Lab Activity 2.

Question pattern needed

Aucun commentaire:

Enregistrer un commentaire