[ create a new paste ] login | about

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

C, pasted on Apr 24:
#include<stdio.h>
#include<conio.h>

int ds(int);

int main()
{
	int n;
	printf("Nhao vao mot gia tri:");
	scanf("%d",&n);
	
	printf("So dao la: %d",ds(n));
	getch();
}

int ds(int &n)
{
	int m= 0;
	do
	{
		m*=10 +n%10;
		n/= 10;
	}while(m != 0);
	
	return m;
}


Output:
1
2
Line 17: error: conio.h: No such file or directory
Line 16: error: expected ';', ',' or ')' before '&' token


Create a new paste based on this one


Comments: