Welcome, guest! Login / Register - Why register?
Psst.. new poll here.
Psst.. new forums here.

Paste

Pasted as C++ by registered user xujiayu ( 4 years ago )
#include <stdio.h>
#include <conio.h>

int tinhtong ( int a, int b)
{
	return a + b;
}
int tinhhieu ( int a, int b)
{
	return a - b;
}
int tinhtich ( int a, int b)
{
	return a * b;
}
float tinhthuong ( int a , int b)
{
	float thuong = (float) a / b;
	return thuong;
}
int main()
	// cach goi ham 
{     
	int a = 1;
	 int b = 2;

	  int tong = tinhtong (a,b);
	  int hieu  = tinhhieu (a,b);
	  int tich = tinhtich (a,b);
	  float thuong = tinhthuong (a,b);
	  printf("\n%d",tong);
	  printf("\n%d",hieu);
	  printf("\n%d",tich);
	  printf("\n%f",thuong);
	
	getch();
	return 0;



}

 

Revise this Paste

Your Name: Code Language: