It's pretty obvious it's not the only thing you have wrong, when your output is "1 is the square root of...".
Quzah.
Type: Posts; User: quzah
It's pretty obvious it's not the only thing you have wrong, when your output is "1 is the square root of...".
Quzah.
So now you are back to:It's not a race. Take your time and read what people are telling you.
Quzah.
To illustrate one step further:
for (i = 0; i < 10; i++) ; {
/* not the loop body */
}That ; makes all the difference.
Quzah.
A semicolon terminates a statement. Loops need a statement attached, typically, to actually do something:
#include<stdio.h>
int main( void )
{
int x = 0;
for( x = 0; x < 10; x++ )
...
That's true. I was only solving the immediate problem at hand. Your in-printf solution is more elegant.
Quazh.
You need to assign the value with =, which you aren't doing, and you don't even have it compilable at the moment:
//cube number
number = number * number * number;
Quzah.
I did this exact thing when I wrote that calculator earlier. ;)
I know where a bunch of functions are from, but I don't have them all memorized. What's the point, when I can make a new tab, go up...
:eyebrow: No wonder your post count is so high!
Quzah.
Because you aren't paying attention to what you are doing, and are really just throwing random bits of code in trying to get lucky:
#include <stdio.h>
#include <math.h>
int main()
{
...
You need to adopt a good indentation style. Watch:
#include <iostream> // this is C++
using namespace std; // so is this
int main() // this should really be (void) instead of just ()
{
int...