C++

//output ???

#include <iostream>

 #define a(x,y) cout<<x;cout<<y;

using namespace std;

main()

{

cout<<5;

if(false) a(2,3);

cout<<10;

}

52310 5310 510 5210 no output syntax error

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

1 solution

To type C++ code , type the tick mark three times , followed by C++ , and end it with 3 tick marks .

LIke this :

" ```c++

```" Now when you'll be actually typing it out , remove the "" from the ends .

Then your code will look like :

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
#include <iostream>

 #define a(x,y) cout<<x;cout<<y;

using namespace std;

main()

{

cout<<5;

if(false) a(2,3);

cout<<10;

}

Btw I guessed it , since it's been a long time since I last used C++ !

Also shouldn't your code have the lines ?

1
2
3
#include<iostream.h>
#include<conio.h>
getch()

A Former Brilliant Member - 6 years, 2 months ago

Log in to reply

No azhaghu ! Conio.h and getch isn't required ! Anyways thank you for suggestions in your previous post ! :D

Gautham V kidiyoor - 6 years, 2 months ago

Log in to reply

Oh! I really must revise C++ then ! Thanks.

A Former Brilliant Member - 6 years, 2 months ago

your main() don't have any void or int

Resha Dwika Hefni Al-Fahsi - 5 years, 7 months ago

c++ if(false) cout<<2; cout(3);

Hasmik Garyaka - 3 years, 8 months ago

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...