Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

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;
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #type #casting #cpp
ADD COMMENT
Topic
Name
7+4 =