Answers for "Types of casting C++"

C++
1

c++ casting

static_cast<int>(some_double);
Posted by: Guest on April-20-2021
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