Basic Arithmetic | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 3

Basic Arithmetic

can anyone please help me with a better trick to solve arithmetic codes... please help.. please

18th Aug 2016, 9:29 PM
Emmett N. Lipholo
Emmett N. Lipholo - avatar
5 Answers
+ 1
Do you have any examples
18th Aug 2016, 10:02 PM
benb
+ 1
int x = 5 int p = 1 while(p <__) { cout<<__ x << endl; p++; } what's the answer please... and I'd appreciate an explanation thanks in advance
18th Aug 2016, 10:29 PM
Emmett N. Lipholo
Emmett N. Lipholo - avatar
+ 1
thank you... the above was a fill in question in the challenge section... I think I clue now.. thanks once again
19th Aug 2016, 3:56 AM
Emmett N. Lipholo
Emmett N. Lipholo - avatar
+ 1
int x = 1; while (x <= 5) { cout << "value is " << x << endl; x = x + 1; } Guys this is the answer, I am a 10 years old boy and think and try then got the correct answer.
13th Apr 2020, 3:33 AM
Waled Moumari
Waled Moumari - avatar
- 1
while ( p< _ ) Well what exactly does p need to be less than? How many times do you want it to run? I assume the "answer" is x ( or 5 ) So while p (1) is less than x ( 5 ) this code is going to: cout<<_x<<endl; p++; This says that while p is less than x, print x's value to screen and increment p by one then start over. Im not sure what you need in the blank space before x, as what you want is pretty vague. But anyways, ignoring that. All youre doing is printing x's value over and over again until p's value is no longer less than x's. For what youre doing, youre better off using a for() statement.
18th Aug 2016, 11:43 PM
Donovan
Donovan - avatar