5. Complete following program to
display multiplication of 6.40
and 300.
Answers
Answered by
9
#include <iostream>
using namespace std;
int main(){
float a=6.40,b=300,c;
c=a*b;
cout<<c<<"\n";
return 0;}
Answered by
1
- As the data types are different we use type casting to get the correct result in the correct form.
Syntax: (type_name) expression ;
data type variable/ expression
- Program to display multiplication of 6.40 and 300 is:
#include <stdio.h>
void main()
{
int b= 300;
float result, a = 6.40 ;
result = (float) b * a; // type casted the variable b to store float variables.
printf ( "The resultant value : %f", result);
}
Similar questions