#include <iostream> using namespace std; int f(int &x, int y =10) (return (++x +y+1);} int main () { int x =11; int y=15; int z =f(y); cout<<z<<" and "<< (x+y) <<endl; return 0; } code example

Example: #include using namespace std; int main() { int a = 3; float b = 4.5; double c = 5.25; double sum; sum = a + b + c; cout << "The sum of a, b, and c is", sum << endl; return 0; }

#include <iostream>
using namespace std;

int main() {
  int a = 3;
  float b = 4.5;
  double c = 5.25;
  double sum;

  sum = a + b + c;

  cout << "The sum of a, b, and c is", sum << endl;
  return 0;
}

Tags:

Cpp Example