0

Where is error?

#include <iostream> using namespace std; int main(); int a=1; { for (int i=1; i<=3; i++); { for (int j=1; j<=5; j++); { cout<<a++ } printf("\n"); } getch() return 0; }

9th Oct 2018, 8:49 PM
Hasan Aydın
Hasan Aydın - avatar
5 odpowiedzi
+ 2
https://code.sololearn.com/cr9vObVx6tNA/# you had a few errors... i guess getch() does not work on sololearn.
9th Oct 2018, 8:56 PM
LONGTIE👔
LONGTIE👔 - avatar
+ 1
It should be: #include <iostream> using namespace std; int main(){ int a=1; for (int i=1; i<=3; i++){ for (int j=1; j<=5; j++){ cout<<a++; } printf("\n"); } getch(); return 0; }
9th Oct 2018, 8:52 PM
Ulisses Cruz
Ulisses Cruz - avatar
+ 1
thank you for all answer.Im delete getch().its true. 12345 678910 1112131415 if i wanna start 5. for ex. 678910 1112131415 1617181920 how is i made?
9th Oct 2018, 9:21 PM
Hasan Aydın
Hasan Aydın - avatar
+ 1
To start counting from 6, just start variable 'a' at 6: int a = 6;
9th Oct 2018, 9:23 PM
Ulisses Cruz
Ulisses Cruz - avatar
+ 1
thank you very much.
9th Oct 2018, 9:26 PM
Hasan Aydın
Hasan Aydın - avatar