#include<iostream>
#include <cstdlib>
#include <math.h>
using namespace std;
int main(){
system("chcp 1251 > null");
int n = 0;
cout << "Задача 1.ntВведіть n: ";
cin >> n;
int i = 1;
while(i<=n){
if(i%7==0) cout << i;
i++;
}
cout << "nn";
int a,b;
cout << "Задача 2.ntВведіть перше число діапазону: ";
cin >> a;
cout <<"ntВведіть друге число діапазону: ";
cin >> b;
double sum = 0;
double sr = 0;
int index = 0;
i = a;
while(i<=b){
sum = sum+i;
index++;
i++;
}
sr = sum / index;
cout << "nnСума: " << sum << "nСереднє арифметичне: " << sr;
int x = 0;
int y = 0;
cout << "nnЗадача 3.ntВведіть x: ";
cin >> x;
cout << "ntВведіть y: ";
cin >> y;
cout << "Результат" << powl(x,y);
}
Вот, переделал прошлую задачу, под while. И кстати, отблагодарить ещё можно нажав кнопочку "Лучший ответ" ;-)