50.38K
Category: programmingprogramming

Algorithms and Programs

1.

Algorithms and Programs

2.

Algorithm
• An algorithm is a procedure used for solving a
problem or performing a computation.
Algorithms act as an exact list of instructions
that conduct specified actions step by step in
either hardware- or software-based routines.

3.

• Cin – c input
• Cout – c output

4.

• #include <iostream>
• using namespace std;
• int main() {
• float a,b,c;
• a = 10;
• b= 20;
• c = a *b;
• cout<<c;
• return 0;}

5.

• #include <iostream>
• using namespace std;
• int main() {
• float a,b,c;
• cout<< “enter the value for a and b”;
• cin>>a>>b;
• c=a-b;
• cout<<c;
return 0;
•}

6.

• #include <iostream>
• using namespace std;
• int main() {
• int a,b;
• a=10; b= 13;
• if(a<b)
• { cout<<“a is less than b”;}
• if (a>b)
• { cout<<“a is greater than b”; }
if (a<=b)
• { cout << “a is less than or equal to b” ; }
• if (a>=b)
• { cout<< “a is greater than or equal to b”; }
• if (a==b)
• { cout<<“a is equal to b”; }
• if (a!=b)
• { cout << “a is not equal to b”;}
• }

7.

• https://www.slideshare.net/THOOYAVANV/coverview-ppt-72294760
English     Русский Rules