C++转换操作符

using namespace std;

main() {
   double a = 21.09399;
   float b = 10.20;
   int c ;

   c = (int) a;
   cout << "Line 1 - Value of (int)a is :" << c << endl ;

   c = (int) b;
   cout << "Line 2 - Value of (int)b is  :" << c << endl ;

   return 0;
}

原创文章,作者:ItWorker,如若转载,请注明出处:https://blog.ytso.com/265440.html

(0)
上一篇 2022年6月7日
下一篇 2022年6月7日

相关推荐

发表回复

登录后才能评论