SlideShare ist ein Scribd-Unternehmen logo
1 von 33
Submitted by:
Ken M. Sahashi
  BM10203




 http://eglobiotraining.com/
#include <iostream>                         case 3: cout<< "Excellent!n";
#include <cstdio>                           break;
using namespace std;                        case 2: cout<< "Masterful!n";
int main()                                  break;
{                                           case 1: cout<< "Incredible!n";
int number;                                 break;
cout<< "Enter a number between 1 and 5:     default: cout<< "Too large!n";
     ";                                     }
cin>> number;                               cout<< "nn";
switch (number)                             system ("pause");
{                                           return 0;
case 0: cout<< "Too small, sorry!";         }
break;
case 5: cout<< "Good job!n";
break;
case 4: cout<< "Nice Pick!n";
break;
                             http://eglobiotraining.com/
http://eglobiotraining.com/
   This programming accepts a number between 1
    and 5 . If the user enters a right number the
    programming will show an output according
    to its number.




                   http://eglobiotraining.com/
#include <iostream>                      cout<< " Enter the width : ";
#include <cstdio>                        cin>>wid;
using namespace std;                     area=len*wid;
int main()                               per=(2*len)+(2*wid);
{                                        switch (ch)
intch, len , wid , area , per ;          {
balik:                                   case 1 : cout<< " The Area is : " <<
system ("cls");                              area <<endl;break;
cout<< " ***** Area - Perimeter          case 2 : cout<< " The perimeter is : "
    Program *******                          <<per<<endl;break;
    "<<endl<<"tt(Rectangle)"<<en       default: gotobalik;
    dl;                                  }
cout<< "n [1] Area n [2] Perimeter
    nnnnn " <<endl;                 system ("pause");
cout<< "Enter your choice here : " ;     return 0;
cin>>ch;                                 }
cout<< " Enter the length : ";
cin>>len;




                            http://eglobiotraining.com/
http://eglobiotraining.com/
This programming computes for the area or
perimeter of a given rectangle given that the
user will input its length and width. After the
programming accepts the values for
dimensions of the rectangle, the programming
lets the user choose if the programming will
compute for its perimeter or area. Then the
programming will compute for whatever the
user chose and then prints the computed value.
Lastly the programming will ask the user to
press any key to end the programming.

               http://eglobiotraining.com/
#include "iostream"                                ";
    using namespace std;                           cin >> x;
    int main ()
    { int rem , x;                                 switch (x)
    balik:                                         {
    system ("cls");                                case 1: cout<< "Your birthstone is
    cout << "[1] January "<<endl;;                 Garnet "<<endl;break;
    cout << "[2] February "<<endl;                 case 2: cout<< "Your birthstone is
    cout << "[3] March "<<endl;                    Amethyst "<<endl;break;
    cout << "[4] April "<<endl;                    case 3: cout<< "Your birthstone is
    cout << "[5] May "<<endl;                      Aquamarine "<<endl;break;
    cout << "[6] June "<<endl;                     case 4: cout<< "Your birthstone is
    cout << "[7] July "<<endl;                     Diamond "<<endl;break;
    cout << "[8] August "<<endl;                   case 5: cout<< "Your birthstone is
    cout << "[9] September "<<endl;                Shamrock "<<endl;break;
    cout << "[10] October "<<endl;                 case 6: cout<< "Your birthstone is
    cout << "[11] November "<<endl;                Alexandrite "<<endl;break;
    cout << "[12] December                         case 7: cout<< "Your birthstone is
    "<<endl<<endl;                                 Ruby "<<
    cout << "Enter the number of month :
                               http://eglobiotraining.com/
   Amethyst "<<endl;break;
    case 3: cout<< "Your birthstone is Aquamarine "<<endl;break;
    case 4: cout<< "Your birthstone is Diamond "<<endl;break;
    case 5: cout<< "Your birthstone is Shamrock "<<endl;break;
    case 6: cout<< "Your birthstone is Alexandrite "<<endl;break;
    case 7: cout<< "Your birthstone is Ruby "<<endl;break;
    case 8: cout<< "Your birthstone is Peridot "<<endl;break;
    case 9: cout<< "Your birthstone is Sapphire "<<endl;break;
    case 10: cout<< "Your birthstone is Rose Zircon "<<endl;break;
    case 11: cout<< "Your birthstone is Topaz "<<endl;break;
    case 12: cout<< "Your birthstone is Blue Zircon "<<endl;break;
    default:system ("cls"); cout<< "Invalid Input!!"<<endl;goto
    balik;break;
    }
    system ("pause");
    return 0;
    }

                          http://eglobiotraining.com/
http://eglobiotraining.com/
This programming will
display the equivalent
birthstone of each month
using switch statement.

           http://eglobiotraining.com/
#include "iostream.h"
using namespace std;
int main ()
{
     system ("cls");
     for (int x = 1 ; x <= 10 ; x++ )
     {
          switch ( x )
          {
                       case 1: cout<< " One "<<endl;break;
                       case 2: cout<< " two "<<endl;break;
                       case 3: cout<< " three"<<endl;break;
                       case 4: cout<< " four "<<endl;break;
                       case 5: cout<< " five "<<endl;break;
                       case 6: cout<< " six "<<endl;break;
                       case 7: cout<< " seven "<<endl;break;
                       case 8: cout<< " eight "<<endl;break;
                       case 9: cout<< " nine "<<endl;break;
                       default: cout<< " ten "<<endl;break;
          }

     system ("pause");
     return 0;
}
                                 http://eglobiotraining.com/
http://eglobiotraining.com/
   This programming allows the user to input a
    number from 1 to 10. If the user input a right
    number,the programming will run correctly
    and it will display the equivalent of the
    number in words.




                    http://eglobiotraining.com/
#include "iostream.h"
using namespace std;
int main ()
{ int rem , x;
    system ("cls")
    cout << "Enter an integer : ";
    cin >> x;
    rem=x%2;
        switch (rem)
        {
                 case 1: cout<< " Odd "<<endl;break;
                 default: cout<< " even "<<endl;break;
        }

    system ("pause");
    return 0;
}

                            http://eglobiotraining.com/
http://eglobiotraining.com/
   This programming allows the user to enter a
    integer number in which it will also display if it
    is even or odd after executing the indicated
    operation in the programming. We all know
    that the number is even if it’s remainder is 0
    and odd if it’s remainder is 1.




                    http://eglobiotraining.com/
#include <iostream>                     fact+=1;
#include <conio.h>                      }
using namespace std;                    }
int main()                              if(fact>0)
{                                       cout<<"COMPOSITE!";
intnum, ctr=2, fact=0;                  else
system ("cls");                         cout<<"PRIME!";
cout<<"Enter a number: ";               }
cin>>num;                               cout<< "n";
{                                       system ("pause");
for (;ctr<num;ctr++)                    return 0;
{                                       }
if(num%ctr==0)        http://eglobiotraining.com/
http://eglobiotraining.com/
   This programming allows the user to input a
    number. This number will be test if it’s a
    PRIME or COMPOSITE.




                   http://eglobiotraining.com/
#include "iostream.h"
using namespace std;
int main ()
{
   system ("cls");
   for (int x = 1 ; x <= 10 ; x++ )
   cout << x << "t" << x*x<< endl;
   system ("pause");
   return 0;
}
                  http://eglobiotraining.com/
http://eglobiotraining.com/
In this programming,the user is allowed to
enter a number from 1 to 10 and once he/she
enters the number the programming will
execute the operation in which it will displays
the square of the number inputted by the user.




                http://eglobiotraining.com/
#include "iostream.h"
using namespace std;
int main ()
{
    system ("cls");
    for (int x = 1 ; x <= 10 ; x++ )
        {for( y=1 ; <=10 ; y++)
        {cout <<"#"<< endl;
                 }
        cout << "t";
                 }
    system ("pause");
    return 0;
}


                             http://eglobiotraining.com/
http://eglobiotraining.com/
   This programming draw a ten by ten sharp
    symbol box using the for loop.




                  http://eglobiotraining.com/
Octal is : "
#include <iostream>                    <<oct<<dec<<endl<<end
using namespace std;                   l;
int main()                          cout<< "Do you wish to try
                                       again [Y/N]? : ";
{ intdec;charch;
                                    cin>>ch;
do
                                    }while (toupper(ch)== 'Y');
  {
                                    system ("pause");
system ("cls");
                                    return 0;
cout<< "Enter a decimal: ";
                                    }
cin>>dec;
cout<< " THe number in

                     http://eglobiotraining.com/
http://eglobiotraining.com/
This programming converts the user’s input of decimal
number system into octal number system. The first step
in this programming is to ask the user to input an
integer of base 10(decimal). Next, the programming
will compute the value of the base 10 into base 8 or
octal number system. After the programming has
computed the value of base 10 integer to octal, now it
will output or print the answer of conversion of
decimal to octal. Then the programming will ask the
user if he/she wants to try again. The programming
accepts only Y for yes and N for a no. Lastly the
programming asks the user to press any key to end the
programming.

                  http://eglobiotraining.com/
#include "iostream"                     }
#include "conio.h"                    cout<< "Trip Executed !!!
using namespace std;                      "<<endl<<endl;
int main ()                           system ("pause");
{                                     return 0;
charch = 'a';                         }
system ("cls");
while (ch !='q')
  {
cin>>ch;

                       http://eglobiotraining.com/
http://eglobiotraining.com/
This programming accepts any character
such as alphanumeric and special
characters(symbols and the like). After
the input of the user, the programming
will now test the entered character. If the
programming reads the letter q or Q the
programming will end and outputs
“PROGRAM EXECUTED”.


              http://eglobiotraining.com/
This powerpoint is saved at
http://www.slideshare.net/

This project is submitted to:
Prof. Erwin Globio
http://eglobiotraining.com/




                  http://eglobiotraining.com/

Weitere ähnliche Inhalte

Was ist angesagt?

Tugas praktikukm pemrograman c++
Tugas praktikukm  pemrograman c++Tugas praktikukm  pemrograman c++
Tugas praktikukm pemrograman c++Dendi Riadi
 
The Ring programming language version 1.5.3 book - Part 89 of 184
The Ring programming language version 1.5.3 book - Part 89 of 184The Ring programming language version 1.5.3 book - Part 89 of 184
The Ring programming language version 1.5.3 book - Part 89 of 184Mahmoud Samir Fayed
 
Евгений Крутько, Многопоточные вычисления, современный подход.
Евгений Крутько, Многопоточные вычисления, современный подход.Евгений Крутько, Многопоточные вычисления, современный подход.
Евгений Крутько, Многопоточные вычисления, современный подход.Platonov Sergey
 
Rust concurrency tutorial 2015 12-02
Rust concurrency tutorial 2015 12-02Rust concurrency tutorial 2015 12-02
Rust concurrency tutorial 2015 12-02nikomatsakis
 
Deterministic simulation testing
Deterministic simulation testingDeterministic simulation testing
Deterministic simulation testingFoundationDB
 
Rust Mozlando Tutorial
Rust Mozlando TutorialRust Mozlando Tutorial
Rust Mozlando Tutorialnikomatsakis
 
Clojure 1.1 And Beyond
Clojure 1.1 And BeyondClojure 1.1 And Beyond
Clojure 1.1 And BeyondMike Fogus
 
The Ring programming language version 1.5.3 book - Part 25 of 184
The Ring programming language version 1.5.3 book - Part 25 of 184The Ring programming language version 1.5.3 book - Part 25 of 184
The Ring programming language version 1.5.3 book - Part 25 of 184Mahmoud Samir Fayed
 
The Magnificent Seven
The Magnificent SevenThe Magnificent Seven
The Magnificent SevenMike Fogus
 
Performance measurement and tuning
Performance measurement and tuningPerformance measurement and tuning
Performance measurement and tuningAOE
 
Abusing text/template for data transformation
Abusing text/template for data transformationAbusing text/template for data transformation
Abusing text/template for data transformationArnaud Porterie
 
Architecture for Massively Parallel HDL Simulations
Architecture for Massively Parallel HDL Simulations Architecture for Massively Parallel HDL Simulations
Architecture for Massively Parallel HDL Simulations DVClub
 
Protocol handler in Gecko
Protocol handler in GeckoProtocol handler in Gecko
Protocol handler in GeckoChih-Hsuan Kuo
 

Was ist angesagt? (20)

Tugas praktikukm pemrograman c++
Tugas praktikukm  pemrograman c++Tugas praktikukm  pemrograman c++
Tugas praktikukm pemrograman c++
 
Rust-lang
Rust-langRust-lang
Rust-lang
 
The Ring programming language version 1.5.3 book - Part 89 of 184
The Ring programming language version 1.5.3 book - Part 89 of 184The Ring programming language version 1.5.3 book - Part 89 of 184
The Ring programming language version 1.5.3 book - Part 89 of 184
 
Евгений Крутько, Многопоточные вычисления, современный подход.
Евгений Крутько, Многопоточные вычисления, современный подход.Евгений Крутько, Многопоточные вычисления, современный подход.
Евгений Крутько, Многопоточные вычисления, современный подход.
 
Clang tidy
Clang tidyClang tidy
Clang tidy
 
Rust concurrency tutorial 2015 12-02
Rust concurrency tutorial 2015 12-02Rust concurrency tutorial 2015 12-02
Rust concurrency tutorial 2015 12-02
 
Introduction to Rust
Introduction to RustIntroduction to Rust
Introduction to Rust
 
Deterministic simulation testing
Deterministic simulation testingDeterministic simulation testing
Deterministic simulation testing
 
Rust Mozlando Tutorial
Rust Mozlando TutorialRust Mozlando Tutorial
Rust Mozlando Tutorial
 
Clojure 1.1 And Beyond
Clojure 1.1 And BeyondClojure 1.1 And Beyond
Clojure 1.1 And Beyond
 
The Ring programming language version 1.5.3 book - Part 25 of 184
The Ring programming language version 1.5.3 book - Part 25 of 184The Ring programming language version 1.5.3 book - Part 25 of 184
The Ring programming language version 1.5.3 book - Part 25 of 184
 
Code as Risk
Code as RiskCode as Risk
Code as Risk
 
The Magnificent Seven
The Magnificent SevenThe Magnificent Seven
The Magnificent Seven
 
Rust
RustRust
Rust
 
Virtual Machine Constructions for Dummies
Virtual Machine Constructions for DummiesVirtual Machine Constructions for Dummies
Virtual Machine Constructions for Dummies
 
Performance measurement and tuning
Performance measurement and tuningPerformance measurement and tuning
Performance measurement and tuning
 
Abusing text/template for data transformation
Abusing text/template for data transformationAbusing text/template for data transformation
Abusing text/template for data transformation
 
Architecture for Massively Parallel HDL Simulations
Architecture for Massively Parallel HDL Simulations Architecture for Massively Parallel HDL Simulations
Architecture for Massively Parallel HDL Simulations
 
Protocol handler in Gecko
Protocol handler in GeckoProtocol handler in Gecko
Protocol handler in Gecko
 
Whispered secrets
Whispered secretsWhispered secrets
Whispered secrets
 

Ähnlich wie Project in programming

Assignement of programming & problem solving
Assignement of programming & problem solvingAssignement of programming & problem solving
Assignement of programming & problem solvingSyed Umair
 
Final requirement in programming vinson
Final requirement in programming  vinsonFinal requirement in programming  vinson
Final requirement in programming vinsonmonstergeorge
 
2 BytesC++ course_2014_c3_ function basics&parameters and overloading
2 BytesC++ course_2014_c3_ function basics&parameters and overloading2 BytesC++ course_2014_c3_ function basics&parameters and overloading
2 BytesC++ course_2014_c3_ function basics&parameters and overloadingkinan keshkeh
 
ch5_additional.ppt
ch5_additional.pptch5_additional.ppt
ch5_additional.pptLokeshK66
 
Fundamentals of programming angeli
Fundamentals of programming angeliFundamentals of programming angeli
Fundamentals of programming angelibergonio11339481
 
54602399 c-examples-51-to-108-programe-ee01083101
54602399 c-examples-51-to-108-programe-ee0108310154602399 c-examples-51-to-108-programe-ee01083101
54602399 c-examples-51-to-108-programe-ee01083101premrings
 
Final requirement in programming
Final requirement in programmingFinal requirement in programming
Final requirement in programmingtrish_maxine
 
Final requirement in programming niperos
Final requirement in programming   niperosFinal requirement in programming   niperos
Final requirement in programming niperosmarkings17
 
C++ and OOPS Crash Course by ACM DBIT | Grejo Joby
C++ and OOPS Crash Course by ACM DBIT | Grejo JobyC++ and OOPS Crash Course by ACM DBIT | Grejo Joby
C++ and OOPS Crash Course by ACM DBIT | Grejo JobyGrejoJoby1
 
C++ L03-Control Structure
C++ L03-Control StructureC++ L03-Control Structure
C++ L03-Control StructureMohammad Shaker
 
Laporan pd kelompok 6
Laporan pd kelompok 6Laporan pd kelompok 6
Laporan pd kelompok 6phoe3
 
Start with the inclusion of libraries#include iostream .docx
 Start with the inclusion of libraries#include iostream .docx Start with the inclusion of libraries#include iostream .docx
Start with the inclusion of libraries#include iostream .docxMARRY7
 
FP 201 - Unit 3 Part 2
FP 201 - Unit 3 Part 2FP 201 - Unit 3 Part 2
FP 201 - Unit 3 Part 2rohassanie
 

Ähnlich wie Project in programming (20)

Assignement of programming & problem solving
Assignement of programming & problem solvingAssignement of programming & problem solving
Assignement of programming & problem solving
 
Oop object oriented programing topics
Oop object oriented programing topicsOop object oriented programing topics
Oop object oriented programing topics
 
Final requirement in programming vinson
Final requirement in programming  vinsonFinal requirement in programming  vinson
Final requirement in programming vinson
 
2 BytesC++ course_2014_c3_ function basics&parameters and overloading
2 BytesC++ course_2014_c3_ function basics&parameters and overloading2 BytesC++ course_2014_c3_ function basics&parameters and overloading
2 BytesC++ course_2014_c3_ function basics&parameters and overloading
 
ch5_additional.ppt
ch5_additional.pptch5_additional.ppt
ch5_additional.ppt
 
Fundamentals of programming angeli
Fundamentals of programming angeliFundamentals of programming angeli
Fundamentals of programming angeli
 
54602399 c-examples-51-to-108-programe-ee01083101
54602399 c-examples-51-to-108-programe-ee0108310154602399 c-examples-51-to-108-programe-ee01083101
54602399 c-examples-51-to-108-programe-ee01083101
 
Final requirement in programming
Final requirement in programmingFinal requirement in programming
Final requirement in programming
 
Final requirement in programming niperos
Final requirement in programming   niperosFinal requirement in programming   niperos
Final requirement in programming niperos
 
C++ and OOPS Crash Course by ACM DBIT | Grejo Joby
C++ and OOPS Crash Course by ACM DBIT | Grejo JobyC++ and OOPS Crash Course by ACM DBIT | Grejo Joby
C++ and OOPS Crash Course by ACM DBIT | Grejo Joby
 
Oop1
Oop1Oop1
Oop1
 
10 template code program
10 template code program10 template code program
10 template code program
 
C++ L03-Control Structure
C++ L03-Control StructureC++ L03-Control Structure
C++ L03-Control Structure
 
Laporan pd kelompok 6
Laporan pd kelompok 6Laporan pd kelompok 6
Laporan pd kelompok 6
 
Start with the inclusion of libraries#include iostream .docx
 Start with the inclusion of libraries#include iostream .docx Start with the inclusion of libraries#include iostream .docx
Start with the inclusion of libraries#include iostream .docx
 
C++ TUTORIAL 2
C++ TUTORIAL 2C++ TUTORIAL 2
C++ TUTORIAL 2
 
C++ TUTORIAL 3
C++ TUTORIAL 3C++ TUTORIAL 3
C++ TUTORIAL 3
 
C++ file
C++ fileC++ file
C++ file
 
C++ file
C++ fileC++ file
C++ file
 
FP 201 - Unit 3 Part 2
FP 201 - Unit 3 Part 2FP 201 - Unit 3 Part 2
FP 201 - Unit 3 Part 2
 

Project in programming

  • 1. Submitted by: Ken M. Sahashi BM10203 http://eglobiotraining.com/
  • 2. #include <iostream> case 3: cout<< "Excellent!n"; #include <cstdio> break; using namespace std; case 2: cout<< "Masterful!n"; int main() break; { case 1: cout<< "Incredible!n"; int number; break; cout<< "Enter a number between 1 and 5: default: cout<< "Too large!n"; "; } cin>> number; cout<< "nn"; switch (number) system ("pause"); { return 0; case 0: cout<< "Too small, sorry!"; } break; case 5: cout<< "Good job!n"; break; case 4: cout<< "Nice Pick!n"; break; http://eglobiotraining.com/
  • 4. This programming accepts a number between 1 and 5 . If the user enters a right number the programming will show an output according to its number. http://eglobiotraining.com/
  • 5. #include <iostream> cout<< " Enter the width : "; #include <cstdio> cin>>wid; using namespace std; area=len*wid; int main() per=(2*len)+(2*wid); { switch (ch) intch, len , wid , area , per ; { balik: case 1 : cout<< " The Area is : " << system ("cls"); area <<endl;break; cout<< " ***** Area - Perimeter case 2 : cout<< " The perimeter is : " Program ******* <<per<<endl;break; "<<endl<<"tt(Rectangle)"<<en default: gotobalik; dl; } cout<< "n [1] Area n [2] Perimeter nnnnn " <<endl; system ("pause"); cout<< "Enter your choice here : " ; return 0; cin>>ch; } cout<< " Enter the length : "; cin>>len; http://eglobiotraining.com/
  • 7. This programming computes for the area or perimeter of a given rectangle given that the user will input its length and width. After the programming accepts the values for dimensions of the rectangle, the programming lets the user choose if the programming will compute for its perimeter or area. Then the programming will compute for whatever the user chose and then prints the computed value. Lastly the programming will ask the user to press any key to end the programming. http://eglobiotraining.com/
  • 8. #include "iostream" "; using namespace std; cin >> x; int main () { int rem , x; switch (x) balik: { system ("cls"); case 1: cout<< "Your birthstone is cout << "[1] January "<<endl;; Garnet "<<endl;break; cout << "[2] February "<<endl; case 2: cout<< "Your birthstone is cout << "[3] March "<<endl; Amethyst "<<endl;break; cout << "[4] April "<<endl; case 3: cout<< "Your birthstone is cout << "[5] May "<<endl; Aquamarine "<<endl;break; cout << "[6] June "<<endl; case 4: cout<< "Your birthstone is cout << "[7] July "<<endl; Diamond "<<endl;break; cout << "[8] August "<<endl; case 5: cout<< "Your birthstone is cout << "[9] September "<<endl; Shamrock "<<endl;break; cout << "[10] October "<<endl; case 6: cout<< "Your birthstone is cout << "[11] November "<<endl; Alexandrite "<<endl;break; cout << "[12] December case 7: cout<< "Your birthstone is "<<endl<<endl; Ruby "<< cout << "Enter the number of month : http://eglobiotraining.com/
  • 9. Amethyst "<<endl;break; case 3: cout<< "Your birthstone is Aquamarine "<<endl;break; case 4: cout<< "Your birthstone is Diamond "<<endl;break; case 5: cout<< "Your birthstone is Shamrock "<<endl;break; case 6: cout<< "Your birthstone is Alexandrite "<<endl;break; case 7: cout<< "Your birthstone is Ruby "<<endl;break; case 8: cout<< "Your birthstone is Peridot "<<endl;break; case 9: cout<< "Your birthstone is Sapphire "<<endl;break; case 10: cout<< "Your birthstone is Rose Zircon "<<endl;break; case 11: cout<< "Your birthstone is Topaz "<<endl;break; case 12: cout<< "Your birthstone is Blue Zircon "<<endl;break; default:system ("cls"); cout<< "Invalid Input!!"<<endl;goto balik;break; } system ("pause"); return 0; } http://eglobiotraining.com/
  • 11. This programming will display the equivalent birthstone of each month using switch statement. http://eglobiotraining.com/
  • 12. #include "iostream.h" using namespace std; int main () { system ("cls"); for (int x = 1 ; x <= 10 ; x++ ) { switch ( x ) { case 1: cout<< " One "<<endl;break; case 2: cout<< " two "<<endl;break; case 3: cout<< " three"<<endl;break; case 4: cout<< " four "<<endl;break; case 5: cout<< " five "<<endl;break; case 6: cout<< " six "<<endl;break; case 7: cout<< " seven "<<endl;break; case 8: cout<< " eight "<<endl;break; case 9: cout<< " nine "<<endl;break; default: cout<< " ten "<<endl;break; } system ("pause"); return 0; } http://eglobiotraining.com/
  • 14. This programming allows the user to input a number from 1 to 10. If the user input a right number,the programming will run correctly and it will display the equivalent of the number in words. http://eglobiotraining.com/
  • 15. #include "iostream.h" using namespace std; int main () { int rem , x; system ("cls") cout << "Enter an integer : "; cin >> x; rem=x%2; switch (rem) { case 1: cout<< " Odd "<<endl;break; default: cout<< " even "<<endl;break; } system ("pause"); return 0; } http://eglobiotraining.com/
  • 17. This programming allows the user to enter a integer number in which it will also display if it is even or odd after executing the indicated operation in the programming. We all know that the number is even if it’s remainder is 0 and odd if it’s remainder is 1. http://eglobiotraining.com/
  • 18. #include <iostream> fact+=1; #include <conio.h> } using namespace std; } int main() if(fact>0) { cout<<"COMPOSITE!"; intnum, ctr=2, fact=0; else system ("cls"); cout<<"PRIME!"; cout<<"Enter a number: "; } cin>>num; cout<< "n"; { system ("pause"); for (;ctr<num;ctr++) return 0; { } if(num%ctr==0) http://eglobiotraining.com/
  • 20. This programming allows the user to input a number. This number will be test if it’s a PRIME or COMPOSITE. http://eglobiotraining.com/
  • 21. #include "iostream.h" using namespace std; int main () { system ("cls"); for (int x = 1 ; x <= 10 ; x++ ) cout << x << "t" << x*x<< endl; system ("pause"); return 0; } http://eglobiotraining.com/
  • 23. In this programming,the user is allowed to enter a number from 1 to 10 and once he/she enters the number the programming will execute the operation in which it will displays the square of the number inputted by the user. http://eglobiotraining.com/
  • 24. #include "iostream.h" using namespace std; int main () { system ("cls"); for (int x = 1 ; x <= 10 ; x++ ) {for( y=1 ; <=10 ; y++) {cout <<"#"<< endl; } cout << "t"; } system ("pause"); return 0; } http://eglobiotraining.com/
  • 26. This programming draw a ten by ten sharp symbol box using the for loop. http://eglobiotraining.com/
  • 27. Octal is : " #include <iostream> <<oct<<dec<<endl<<end using namespace std; l; int main() cout<< "Do you wish to try again [Y/N]? : "; { intdec;charch; cin>>ch; do }while (toupper(ch)== 'Y'); { system ("pause"); system ("cls"); return 0; cout<< "Enter a decimal: "; } cin>>dec; cout<< " THe number in http://eglobiotraining.com/
  • 29. This programming converts the user’s input of decimal number system into octal number system. The first step in this programming is to ask the user to input an integer of base 10(decimal). Next, the programming will compute the value of the base 10 into base 8 or octal number system. After the programming has computed the value of base 10 integer to octal, now it will output or print the answer of conversion of decimal to octal. Then the programming will ask the user if he/she wants to try again. The programming accepts only Y for yes and N for a no. Lastly the programming asks the user to press any key to end the programming. http://eglobiotraining.com/
  • 30. #include "iostream" } #include "conio.h" cout<< "Trip Executed !!! using namespace std; "<<endl<<endl; int main () system ("pause"); { return 0; charch = 'a'; } system ("cls"); while (ch !='q') { cin>>ch; http://eglobiotraining.com/
  • 32. This programming accepts any character such as alphanumeric and special characters(symbols and the like). After the input of the user, the programming will now test the entered character. If the programming reads the letter q or Q the programming will end and outputs “PROGRAM EXECUTED”. http://eglobiotraining.com/
  • 33. This powerpoint is saved at http://www.slideshare.net/ This project is submitted to: Prof. Erwin Globio http://eglobiotraining.com/ http://eglobiotraining.com/