c++ program for addition of two numbers using functions
C++
#include <iostream>
using namespace std;
//function declaration
int addition(int a,int b);
int main()
{
int a,b; //to store numbers
int add; //to store addition
//read numbers
cout<<"Enter first number: ";
cin>>a;
cout<<"Enter second number: ";
cin>>b;
//call function
add=addition(a,b);
//print addition
cout<<"Addition is: "<<add<<endl;
return 0;
}
//function definition
int addition(int a,int b)
{
return (a+b);
}
Also in C++:
- Title
- namespace file linking c++
- Category
- C++
- Title
- array 2d to 1d
- Category
- C++
- Title
- how to delete an element in vector pair in cpp
- Category
- C++
- Title
- double pointers C++
- Category
- C++
- Title
- number of islands leetcode code
- Category
- C++
- Title
- double to string c++
- Category
- C++
- Title
- how to format decimal palces in c++
- Category
- C++
- Title
- what is iterator in c++?
- Category
- C++
- Title
- erase in set
- Category
- C++
- Title
- c++ delet from memory
- Category
- C++
- Title
- sort function in vector c++ stl
- Category
- C++
- Title
- c++ remove element from vector
- Category
- C++
- Title
- function template
- Category
- C++
- Title
- run cmd command c++
- Category
- C++
- Title
- c++ overloaded == operator
- Category
- C++
- Title
- c++ raw string
- Category
- C++
- Title
- how to run a c++ program in the background
- Category
- C++
- Title
- never gonna give you up lyrics
- Category
- C++
- Title
- how to create object in c++
- Category
- C++
- Title
- never gonna give you up
- Category
- C++
- Title
- bellman ford algorithm cp algorithm
- Category
- C++
- Title
- cpp loop through object
- Category
- C++
- Title
- How to find the suarray with maximum sum using divide and conquer
- Category
- C++
- Title
- case label in c++
- Category
- C++
- Title
- sfml default program
- Category
- C++
- Title
- find all the palindrome substring in a given string
- Category
- C++
- Title
- c++ template function
- Category
- C++
- Title
- how to get size of 2d vector in c++
- Category
- C++
- Title
- digitalwrite C++
- Category
- C++
- Title
- length of string c++
- Category
- C++
- Title
- c++ clear console
- Category
- C++
- Title
- root to leaf path print
- Category
- C++
- Title
- c++ replace substrings
- Category
- C++
- Title
- how to make a 2d vector in c++
- Category
- C++
- Title
- bfs in C++
- Category
- C++
- Title
- c++ class inheritance
- Category
- C++
- Title
- how to check a number in string
- Category
- C++
- Title
- static_cast c++
- Category
- C++
- Title
- c++ declare variable
- Category
- C++
- Title
- c++ main function
- Category
- C++
- Title
- how do for loops on c++
- Category
- C++
- Title
- object reference not set to an instance of an object c#
- Category
- C++
- Title
- new class * [] c++
- Category
- C++
- Title
- c++ program how to let the user choose different game modes
- Category
- C++
- Title
- Read multiple files(.txt) c++
- Category
- C++
- Title
- how are graphics in games made
- Category
- C++
- Title
- ternary operator c++
- Category
- C++
- Title
- how to append an element to an array in cpp
- Category
- C++
- Title
- how to find the mode of a vector c++
- Category
- C++
- Title
- c++ get length of array
- Category
- C++
- Title
- array sort c++
- Category
- C++
- Title
- how to make a switch case statement in c++
- Category
- C++
- Title
- command line options in c++
- Category
- C++
- Title
- count function c++
- Category
- C++
- Title
- iterative preorder traversal
- Category
- C++
- Title
- goto c++
- Category
- C++
- Title
- how to convert string to int c++
- Category
- C++
- Title
- size of a matrix using vector c++
- Category
- C++
- Title
- how to iterate trough a vector in c++
- Category
- C++
- Title
- initialize 2d array c++
- Category
- C++
- Title
- what is order in of preeendence in float, int, char, bool
- Category
- C++
- Title
- c++ how to skip the last element of vector
- Category
- C++
- Title
- C++ w3schools
- Category
- C++
- Title
- c++ code 2d block
- Category
- C++
- Title
- how to reverse a vector
- Category
- C++
- Title
- to_string c++
- Category
- C++
- Title
- c++ rainbow text
- Category
- C++
- Title
- C++ and endl
- Category
- C++
- Title
- max in c++
- Category
- C++
- Title
- variabvles in c++
- Category
- C++
- Title
- Html tabulation
- Category
- C++
- Title
- How to find the kth smallest number in cinstant space
- Category
- C++
- Title
- double to int c++
- Category
- C++
- Title
- pyqt connect
- Category
- C++
- Title
- c++ lettura file
- Category
- C++
- Title
- std string find character c++
- Category
- C++
- Title
- subtracting two large numbers
- Category
- C++
- Title
- size of a matrix c++
- Category
- C++
- Title
- change int to string cpp
- Category
- C++
- Title
- cpp create lambda with recursion
- Category
- C++
- Title
- how to open an input file in c++
- Category
- C++
- Title
- cs1955 unity vector3
- Category
- C++
- Title
- how to grab all of user input c++
- Category
- C++
- Title
- declaration vs. definition cpp
- Category
- C++
- Title
- passing array to function in c++
- Category
- C++
- Title
- c++ multidimensional vector
- Category
- C++
- Title
- set in c++
- Category
- C++
- Title
- new in c++
- Category
- C++
- Title
- type id c++
- Category
- C++
- Title
- c++ comment
- Category
- C++
- Title
- how long can a c++ string be
- Category
- C++
- Title
- how to type cast quotient of two integers to double with c++
- Category
- C++
- Title
- c++ wait for user input
- Category
- C++
- Title
- stoi c++
- Category
- C++
- Title
- matrix eigen c++ example
- Category
- C++
- Title
- c++ excel cell blank cells
- Category
- C++
- Title
- c++ function to find minimum element in array
- Category
- C++
- Title
- convert decimal to binary in c++
- Category
- C++
- Title
- c++ do you not inherit constructor
- Category
- C++
- Title
- binary search stl in c++
- Category
- C++