[ create a new paste ] login | about

Link: http://codepad.org/G0uR8yN5    [ raw code | output | fork ]

C++, pasted on Oct 21:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include<iostream>
using namespace std;
int swap(int x, int y)
{
	int a;
	a = x;
	x= y;
	y = a;
}
void main()
{
	int x, y;
	cout << "Enter X";
	cin >> x;
	cout << "Enter y";
	cin >> y;
	swap(x,y);
	cout << "x=" << x <<endl<< "y=" << y << endl;
	system("pause");
}


Output:
1
2
Line 10: error: '::main' must return 'int'
compilation terminated due to -Wfatal-errors.


Create a new paste based on this one


Comments: