👤

CodeBlocks

Za pomocą instrukcji "for" napisz program wypisujący n (podaną przez użytkownika) kolejnych liczb naturalnych.​


Odpowiedź :

Odpowiedź:

#include <iostream>

using namespace std;

int main(int argc, char const *argv[])

{

   int n;

   cout << "Podaj n" << endl;

   cin >> n;

   cout << "Liczby calkowite do " << n << endl;

   

   for (int i = 1; i <= n; i++)

   {

       cout << i << endl;

   }

   return 0;

}

Wyjaśnienie:

Jak coś to pytaj :)