What's new

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

awalstuya

Honorary Poster
Established
Joined
Jun 5, 2015
Posts
363
Solutions
1
Reaction
140
Points
248
Age
26
1651473062763.png

1651473072608.png
 

Attachments

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;
}
 
Last edited:

Similar threads

Back
Top