You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#include<iostream>usingnamespacestd;intmain() {
double num_double = 56.76;
int num_int = num_double;
cout << "The value of int is " << num_int<< endl;
return0;
}
B.
#include<iostream>usingnamespacestd;intmain() {
int num_int = 45;
double num_double = num_int;
cout << "The number of double is " << num_double;
return0;
}
C.
#include<iostream>usingnamespacestd;intmain() {
double num_double = 56.76;
//c styleint num_int = (int)num_double;
//function notation
num_int = int(num_double);
cout << "The given double value is " << num_double << endl;
cout << "C Style integer type casting = " << num_int << endl;
cout << "Integer Type Casting using function notation is = " << num_int;
return0;
}