programming 2
chapter 1
Introduction
''we have three approach
1, procedural progreamming
list of instraction in a single block
ex
#include <iostream>
using namespace std;
void main ()/ int main()
{
list some part of your problem;
returb 0;
}
this approach isn't figure out big task
but only to solve small case
it suitable for solve some part
2, modular programming
in this procedure we divide into functional
eg
void main ()
{
function1 ()
function2 ()
}
also this not comfortable with relat real world
it difficult to variable(local) .
data remain alive within module
two type variable
global and local
local : use in specific place
global : use anywhere (through out program)
modern application create global variable
eg ETM application
have some function
withdrawal()
check_balance()
gen.pin()
mini stmt()
also having some global variable
pin(before withdrawal using your pin)
balance(after withdrawal how much money you want)
name
3.... cont
chapter 1
Introduction
''we have three approach
1, procedural progreamming
list of instraction in a single block
ex
#include <iostream>
using namespace std;
void main ()/ int main()
{
list some part of your problem;
returb 0;
}
this approach isn't figure out big task
but only to solve small case
it suitable for solve some part
2, modular programming
in this procedure we divide into functional
eg
void main ()
{
function1 ()
function2 ()
}
also this not comfortable with relat real world
it difficult to variable(local) .
data remain alive within module
two type variable
global and local
local : use in specific place
global : use anywhere (through out program)
modern application create global variable
eg ETM application
have some function
withdrawal()
check_balance()
gen.pin()
mini stmt()
also having some global variable
pin(before withdrawal using your pin)
balance(after withdrawal how much money you want)
name
3.... cont
👍2❤1
#include <iostream>
using namespace std;
int main()
{
int initial=0, current= 5 , value , number= 3;
//cout << "item of mobile card number" <<endl;
//cin>> number;
for (int i=1; i<= number; i++ ){
value= initial + current;
cout<<"numbers of "<< value<< " "<<endl;
initial= value;
}
return 0;
}
using namespace std;
int main()
{
int initial=0, current= 5 , value , number= 3;
//cout << "item of mobile card number" <<endl;
//cin>> number;
for (int i=1; i<= number; i++ ){
value= initial + current;
cout<<"numbers of "<< value<< " "<<endl;
initial= value;
}
return 0;
}
👍2