Programming-Cpp

Tasks studies - laboratory


Project maintained by dawidolko Hosted on GitHub Pages — Theme by dawidolko

Exam 2

Task 1.

Write a program that calculates the area of ​​a rectangle with user-specified side lengths a and b.

Task 2.

Write a program that determines the greater of the rational numbers provided by the user.

Task 3.

Write a program that after entering the number n will print out the multiples of the number 5 from the interval [n, 7n]

Task 4.

Write a program that will allow you to enter 5 numbers and print out the sum of the entered negative numbers and their quantity.

Task 5.

Write (draw) a diagram of the algorithm written in the program:

#include <iostream>
using namespace std;
int main()
{
  int x,z; int n=0, int y=1;
  cin>>z;
  to
  {
    cin>>x;
    y=x*y;
    ++n;
    }
    while(y<z);
      cout<<"y is ";
      cout<<y<<endl;
      cout<<"n is "<<n;
      return 0;
  }