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

Status
Not open for further replies.

aewrin

Elite
1651473062763.webp

1651473072608.webp
 
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
  • 482
    Views
  • 6
    Participants
Last reply from:
Aoshinomori

Trending Topics

Online now

Members online
1,102
Guests online
1,742
Total visitors
2,844

Forum statistics

Threads
2,286,663
Posts
29,039,428
Members
1,217,114
Latest member
Tanjiro999
Back
Top