Wednesday, May 20, 2020

Declaring variables in C++

  • Syntax :


     type variable = value;

  • Program :
#include <iostream>
using namespace std;

int main() {
  cout <<"\n----------------DECLARING VARIABLE----------------\n";
  int x = 5, y = 6, z = 50; 
  cout << x + y + z;
  return 0;
}

  • Output :

No comments:

Post a Comment

Function Overloading in C++

https://monitechvenkat1620.blogspot.com Program : #include <iostream> using namespace std; int c(int x, int y) {   return...