Skip to content

Commit

Permalink
add 1
Browse files Browse the repository at this point in the history
  • Loading branch information
DaniilVdovin committed May 22, 2023
1 parent 9a2cebe commit 60f02be
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions Source/Pointers/1.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#include <iostream>
#include <math.h>
using namespace std;
void fun(float* Perimeter, float* Square, float* Diagonal, float* Side) {
*Perimeter = *Side * 4;
*Diagonal = sqrtf(2 * *Side * *Side);
*Square = powf(*Side, 2.0);
}
int main() {
float Perimeter, Square, Diagonal, Side;
cin >> Side;
fun(&Perimeter, &Square, &Diagonal, &Side);
cout.precision(2);
cout << endl << fixed << Perimeter << " " << Diagonal << " " << Square << endl;
return 0;
}

0 comments on commit 60f02be

Please sign in to comment.