Notices
 

Thread: c++ program

Results 1 to 7 of 7
  1. Default c++ program 
    #1
    Join Date
    Sep 2007
    Location
    Six feet below the ground
    Posts
    780
    Rep Power
    14
    hi there!
    need help i need a simple c++ program with a function or subprogram on it... if meron kau.. plz pahingi copy ng codes.. kahit simple lang... i should be programming one kaso wala pa me compiler and im so busy eh... plz lang po...
     

  2. Default  
    #2
    Join Date
    Apr 2007
    Location
    Biliran, Leyte, Philippines, Philippines
    Posts
    457
    Rep Power
    15
    I can help you with that, but what kind of program do you want?
     

  3. Default  
    #3
    Join Date
    Sep 2007
    Location
    Six feet below the ground
    Posts
    780
    Rep Power
    14
    kuya.. any c++ program that contains a function or a subprogram on it... pwde email nlng po at [email protected]
     

  4. Default  
    #4
    Join Date
    Apr 2007
    Location
    Biliran Island
    Posts
    980
    Rep Power
    10
    justme., daghan ko ana. but ako pang hilngon sa kaban..

    btw try to use Google

    type
    "c++ + function subprogram"
    "the heart has its reasons which reasons cannot understand"....
     

  5. Default  
    #5
    Join Date
    Sep 2007
    Location
    Six feet below the ground
    Posts
    780
    Rep Power
    14
    Quote Originally Posted by jalmz
    justme., daghan ko ana. but ako pang hilngon sa kaban..

    btw try to use Google

    type
    "c++ + function subprogram"
    ok, kuya thnx... im trying to program na man... but if meron po kau... maybe it'l help... thnx talaga
     

  6. Default  
    #6
    Join Date
    Apr 2007
    Location
    Biliran, Leyte, Philippines, Philippines
    Posts
    457
    Rep Power
    15
    Here you go, its a simple cpp program that adds two numbers using function.


    Code:
    #include<iostream.h>
    #include<conio.h> //This header file is the library of clrscr() & getch()
    
    int num1, num2, sum; // global declaration
    
    void add (void); // function declaration
    
    void main()
    {
    clrscr(); // clears the user screen
    cout << "This is a sample program that adds to numbers" << endl;
    add(); // A Function call
    getch(); // Waits for a keyboard hit before exiting the program
    }
    
    void add(void)
    {
    cout << "\nEnter the 1st number: ";
    cin >> num1; 
    cout << "\nEnter the 2nd number: ";
    cin >> num2;
    
    sum = num1 + num2; // adds the two numbers
    
    cout << "\nThe sum of the two numbers is " <<sum << endl;
    cout << "\nPress any key to exit...";
    }
     

  7. Default  
    #7
    Join Date
    Sep 2007
    Location
    Six feet below the ground
    Posts
    780
    Rep Power
    14
    kuya, thnks...
     

Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. What's your favorite Radyo Natin Program?
    By jalmz in forum Radyo Natin 103.9 FM Naval
    Replies: 2
    Last Post: 12-11-2007, 02:30 PM
  2. Replies: 1
    Last Post: 08-07-2007, 03:02 PM
Bookmarks
Bookmarks
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •