[ create a new paste ] login | about

Link: http://codepad.org/tDwm9aJU    [ raw code | output | fork | 6 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
posted by luongphongnhan on Oct 22
#include<iostream>
using namespace std;
int timMax(int a, int b, int c) {
int max;
max = a;
if (b > max) {
max = b;
}
if (c > max) {
max = c;
}
return max;
}

int main() {
int so1, so2, so3;
cout << "Moi nhap 3 so: " << endl;
cin >> so1 >> so2 >> so3;
cout << "Max cua 3 so la: " << timMax(so1, so2, so3) << endl;
system("pause");
return 0;

}
reply
posted by luongphongnhan on Oct 22
#include<iostream>
using namespace std;
int main() {
int soMin;
int tong = 0;
for (int i = 0; i < 10000; i++)
{
tong += i;
if (tong > 10000) {
soMin = i;
cout << "Gia tri min la: " << soMin << endl;
break;
}
}
system("pause");
return 0;
}#include<iostream>
using namespace std;
int main() {
int soMin;
int tong = 0;
for (int i = 0; i < 10000; i++)
{
tong += i;
if (tong > 10000) {
soMin = i;
cout << "Gia tri min la: " << soMin << endl;
break;
}
}
system("pause");
return 0;
}
reply
posted by lehoangan01 on Nov 3
#include <iostream>
using namespace std;

int main() {
int a, b, c;
cout << " pls input a, b, c" << endl;
cin >> a;
cin >> b;
cin >> c;
int max = a;
if (a < b){
max = b;
}
if (a < c){
max = c;
}
cout << "max is " << max << endl;
return 0;
}

reply
posted by 20223768 on Sep 25
#include<iostream>
using namespace std;
int main()
{
float a, b;
cin >> a>>b;
if (a*b==0) cout << "a hoac b bang 0";
else
{
if (a*b<0) cout << "a va b trai dau";
else cout << "a va b cung dau";
}
return 0;
}
reply