Website link: https://techifyshreyansh.blogspot.com/2021/04/lecture-17-functions-default-and.html

Hey guys in this lecture I have talked about the functions and how to call a function in C++. Also we have discussed about the default and constants arguments in C++.

lecture link: https://youtu.be/JaMAJDzO7Yc

#include<iostream>

using namespace std;

float moneyreceived(int currentmoney, float factor=1.04){

return currentmoney * factor;

}

int main(){

// int a, b;

// cout<<”enter the value of a and b “<<endl;

// cin>>a>>b;

int money =354637838;

cout<<”If u have “<<money<<” Rs in your bank account, u will recieve “<<moneyreceived(money)<<” Rs after one month”<<endl;

cout<<”FOR VIP: If u have “<<money<<” Rs in your bank account, u will recieve “<<moneyreceived(money, 1.1)<<” Rs after one month”<<endl;

return 0;

}

--

--

website link: https://techifyshreyansh.blogspot.com/2021/04/lecture-16-function-and-function.html

In this lecture I have discussed about the FUNCTIONS in C++. and also talk aboutFUNCTION PROTOTYPES. In this we learn how to call a FUNCTION in C++.

And what are function prototypes and how to execute it in our programs.

LECTURE LINK: https://youtu.be/XAHUXrUMq5U

#include<iostream>

using namespace std;

//****************function prototype********************

//syntax: type function_name(arguments);

//int sum(int a , int b); // — — — — ->>> acceptable

int sum(int, int);// — — — — — — ->>>acceptable…… means both are acceptable

void g(void);

int main(){

int num1, num2;

cin>>num1;

cin>>num2;

// num1 and num2 are actual arguments

cout<<”the sum is “<<sum(num1, num2);

g();

return 0;

}

int sum(int a, int b){

//formal parameters a and b taking value from actual parameters num1 and num2

int c= a+b;

return c;

}

void g(){

cout<<”\nhello im shreyansh “<<endl;

}

--

--

In this lecture 5 we talk about the input and output stream and what is insertion and extraction in c++ and how to take input from user in c++ .

youtube link of lecture 5: https://youtu.be/nLcJNv8Gvao

If u have any doubt regarding to c++ than please comment it .

#include<iostream>

using namespace std;

int main()

{

// int a=4;

// int b=5;

int a,b;

// or u can use in this way int a, b;

cout<<”enter the valuse of a “<<endl;

cin>>a;

cout<<”enter the valuse of b “<<endl;

cin>>b;

cout<<”the sum of a and b is “<<(a+b)<<endl;

return 0;

}

--

--

TECHIFY SHREYANSH

TECHIFY SHREYANSH

Techify shreyansh is attempt to teach coding techniques to people in short time which took me ages to learn.My blog is: https://techifyshreyansh.blogspot.com/