What's new

Closed C++ program

Status
Not open for further replies.

Aelamae

Addict
Joined
May 6, 2016
Posts
62
Reaction
13
Points
83
patulong po need ko po ng mga sample program sa c++ 10 basic programs of;for,while,do while,array
para lang po sa project sana...
 
mas mabuti search mo nalang sa google marami lalabs niyan

search mo lang while condtion c++ program then for condition and so on kung ano mga gagawin mo marami sa google yan ka ph
 
kaunti lang alam ko sa C++ kasi C language lang kasi tinuro samin pero medyo may alam ako sa basics dyan e lagay mo function diyan para matignan ko


tatlong activity ko..
1.Write a function that will display any name 5 times.

2.Write your own x^y function.

3.Write your own day_of_the_week function. A day_of_the_week function returns the name of the day. Ex. Day(1) = "Sunday"; Day(7) = "Saturday

pano ba gawin ito?
 
g
tatlong activity ko..
1.Write a function that will display any name 5 times.

2.Write your own x^y function.

3.Write your own day_of_the_week function. A day_of_the_week function returns the name of the day. Ex. Day(1) = "Sunday"; Day(7) = "Saturday

pano ba gawin ito?
gumawa kalang ng function mo na nasa loob ang code instead na ilagay mo sa main mo mag declare kalang function sa itaas
 
tatlong activity ko..
1.Write a function that will display any name 5 times.

2.Write your own x^y function.

3.Write your own day_of_the_week function. A day_of_the_week function returns the name of the day. Ex. Day(1) = "Sunday"; Day(7) = "Saturday

pano ba gawin ito?

Number 1

void printName(char *str){
for(int i = 0; i != 5; i++){
cout<<"\n"<<str;
}
}


Number 3

char *day(int i){
char *strDay[7] = {"SUNDAY", "MONDAY", "TUESDAY", "WEDNESDAY", "THURSDAY", "FRIDAY", "SATURDAY"};
return strDay[i -1];
}
 
Last edited:
sir iyong Write your own x^y function pano ba gawin po ito?

sir iyong Write your own x^y function pano ba gawin po ito?

ano nga po pala ilalagay sa heading me kalituhan po..iyong mga basic syntax nakaka intindi na ako ng konti pero di ko parin alam pano i compile..

sir nag try ako me error di ko ako alam kung anong header ba ilalagay sa answer 1 and 3
 
Google might be a good option...

di ko pa rin ma gets kahit i google ko iba talaga iyong help from a friend ika nga they have learn from their experience get an idea from the experts... pls help me if you can contribute from my burden...salamat po...
 
di ko pa rin ma gets kahit i google ko iba talaga iyong help from a friend ika nga they have learn from their experience get an idea from the experts... pls help me if you can contribute from my burden...salamat po...

ganun ba... di ko na kabisado hehehe... sayang... tagal na nung huli Kong ginamit yan...
 
Yong number 2, sinadya ko ng hindi sagutin kasi kaya ng sagutin yon ng number 1. Loop lang yon sir. Maglagay ka lang ng 2 parameter yong x at y mo.


sir pwede kayang i tutor nyo just like a simple ABC... di ma abot ng learning ko wala syang basic structure..

microsoft visual c++ ang environment ko po..
 
sir pwede kayang i tutor nyo just like a simple ABC... di ma abot ng learning ko wala syang basic structure..

microsoft visual c++ ang environment ko po..


Babae po ako sir. I manual mo muna sir.

x ^y ang x ay imumultiply sa sarili niya ng y na ulit

6 ^5 = ang 6 ay imumultiply sa sarili niya ng 5 ulit.

Translate mo yan sa loop sir. Kaya mo iyan.
 
#include <iostream>
#include <cmath>
using namespace std;

int main() {
int x;
float y;

cout << "Enter base and exponent respectively: ";
cin >> x>> y;

cout << "Result = " << pow(x, y);
return 0;
}



pano ba lagyan ito ng function?
 
Status
Not open for further replies.

Similar threads

Back
Top