If statement problem

Anyone could help me fix the following if statement ?

1
2
3
4
5
6
7
8
9
10
#include "stdafx.h"
#include <iostream>
using namespace std;

int main();
{
If (x > (1 + x * x)) {
Y = x * x
Cout<<”x = “ << x <<” and y = “ << y << “\n”;
}
Closing bracket on the if statement?
which closing bracket ? could u show me ? thanks.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include <iostream>

using namespace std;

int main( ) // can't have a ';' here
{
    
    if(x > ( 1 + x * x ) ) { // the 'i' in the if can't be cap
         
       y = x * x;
       
       cout << "x = " << x << " and y = " << y << endl; // the 'c' in cout can't be cap. 
       
    } //  this is were you are missing that bracket 
     
    return( 0 );
}

thanks !
Topic archived. No new replies allowed.