🔒 Closed Baka po may marunong mag C++ po dyan, pa help naman po

Status
Not open for further replies.
Aralin mo sir, madami kang makukuhang reference sa google.
Nakakadala yung papagawa tapos pag ikaw na mismo gagawa mahihirapan ka din

Okay lang magpagawa if need na need na talaga (happened to me no choice na)
pero kung may time ka, take time to learn boss magagamit mo din yan sa mga susunod mong projects/activities
 
ez lang nyan, basic c++ for engg student. haha. ganyan din sunject ko nuon , nilagyan ko pa ng kulay at pablink blink pa. hahaha
 
Yung para sa una

C++:
#include "stdafx.h"
#include <iostream>

using namespace std;

int main()
{
    int array[5];
    int sum=0;
    cout << "Enter 5 numbers separated by space" <<endl;
    
    for (int i = 0; i < 5; i++)
    {
        cin >> array[i];
        sum = sum + array[i];
    }
    cout << "Sum =" << sum;
    getchar();
    getchar();
    return 0;
}

Yung para sa pangalawa

C++:
#include "stdafx.h"
#include <iostream>

using namespace std;

int main()
{
    int SalaryAmount[6] = { 25000,35000,55000,70000,80200,90500 };
    int input;
    cout << "Enter the salary code (1 through 6):" <<endl;
    cin >> input;
    if (input < 1 || input >6)
    {
        cout << "Invalid code";
    }
    else
    {
        cout << "Salary: " << SalaryAmount[input - 1];
    }

    getchar();
    getchar();
    return 0;
}
 
Status
Not open for further replies.

About this Thread

  • 5
    Replies
  • 490
    Views
  • 6
    Participants
Last reply from:
Aoshinomori

Trending Topics

Online now

Members online
766
Guests online
3,840
Total visitors
4,606

Forum statistics

Threads
2,303,238
Posts
29,153,021
Members
1,198,213
Latest member
ASASDASDa
Back
Top