Answers for "Define type casting in C++."

C++
0

type casting in cpp

int main()
{
	int a=20 , b= 25 , c= 19;
  	int sum = a + b + c;
  	float ave = (float) sum / 3;  //this is called type casting (float) sum 
  	cout<<"Average is : "<<ave<<endl;
  	return 0;
}
Posted by: Guest on September-14-2021

Browse Popular Code Answers by Language