E-zone

Predict the Output of the following code:


#include <iostream.h>
main()
{
 int n = 4, k = 2;
 cout << ++n << endl;
 cout << n << endl;
 cout << n++ << endl;
 cout << n << endl;
 cout << -n << endl;
 cout << n << endl;
 cout << --n << endl;
 cout << n << endl;
 cout << n-- << endl;
 cout << n << endl;
cout << n + k << endl;
 cout << n << endl;
 cout << k << endl;
 cout << n << k << endl;
 cout << n << endl;
 cout << " " << n << endl;
 cout << " n" << endl;
 cout << "\n" << endl;
 cout << " n * n = "; //CAREFUL!
 cout << n * n << endl;2
 cout << 'n' << endl;
 return 0;
}

0 comments :

Back to top ↑
Connect with Us

    Total Pageviews

    Powered by Blogger.

    Followers

    Blogroll

What they says

© 2013 The Programming Trailblazers . WP Mythemeshop Converted by Bloggertheme9
Blogger templates . Proudly Powered by Blogger .