[ create a new paste ] login | about

Link: http://codepad.org/tDwm9aJU    [ raw code | output | fork | 2 comments ]

C, pasted on Sep 6:
#include<stdio.h>
#include<conio.h>

int main()
{
	float a, b, c, max;
	printf("\nNhap a: ");
	scanf("%f", &a);

	printf("\nNhap b: ");
	scanf("%f", &b);

	printf("\nNhap c: ");
	scanf("%f", &c);

	max = a;
	if(max < b)
		max = b;
	if(max < c)
		max = c;
	printf("\nSo lon nhat trong 3 so %10.3f, %10.3f, %10.3f, la: %10.3f", a, b, c, max);


	getch();
	return 0;

}


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


Create a new paste based on this one


Comments:
posted by hieunv1996 on Nov 19
Tôi đến từ khóa học lập trình C miễn phí của anh Hiếu
https://nguyenvanhieu.vn/khoa-hoc-lap-trinh-c/
reply
posted by yonnon on Jul 12
#include<bits/stdc++.h>

using namespace std;
int main(){
float a,b,c;
float max=0;
cout << "a= ";
cin >> a;
cout << "b= ";
cin >> b;
cout << "c= ";
cin >> c;

if(a>b){
max=a;
}
else if(b>c){
max=b;
}
else if(c>a){
max=c;
}
cout<<"Max= "<<max<<
endl;
cin.ignore();
return 0;
}
reply