[ create a new paste ] login | about

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

C, pasted on Apr 26:
#include<stdio.h>
#include<conio.h>
int main()
{
// Nhập n là số nguyên dương, nếu sai thì nhập lại
	int n;
	int dem = 0;
	do
	{
		
		printf("\nNhap vao so nguyen duong n: ");
		scanf_s("%d", &n);

		if (n < 0)
		{
			dem++;
			if (dem == 3)
			{
				printf("\nBan da nhap sai 3 lan. Chuong trinh se tu dong thoat!");
				break;
			}
			printf("\nGia tri n phai la so duong. Xin kiem tra lai! ");
		}

	} while (n < 0);

}


Output:
1
Line 17: error: conio.h: No such file or directory


Create a new paste based on this one


Comments: