🔒 Closed Tanong lang

Status
Not open for further replies.
di ko kabisado syntax ng "c++" pero kung sa "c" ganito pag gawa nyan then convert mo na lang sa c++ na language..

int main()
{
int option;
printf("Options\n");
printf("1: if you are a boy\n");
printf("2: if you are a girl\n");
printf("3: if you are a male\n");
printf("4: if you are a female\n");
printf("Select option: ");
scanf(" %d", &option);

switch(option)
{
case 1: printf("Boy");
//Output if 1 is selected: Boy
break;

case 2: printf("Girl");
//Output if 2 is selected: Girl
break;

case 3: printf("Male");
//Output if 3 is selected: Male
break;

case 4: printf("Female);
//Output if 4 is selected: Female
break;

default: printf("Invalid Input!");
//Output if key entered not between 1 to 4: Invalid Input!
break;
}
return 0;

}
 
cno po marunong gumawa ng GUI at codes for time scheduling sa matlab ..?patulong po may reward po kayo kuing cno yung mka tulong kapag maganda nmn.. tnx..
 
di ko kabisado syntax ng "c++" pero kung sa "c" ganito pag gawa nyan then convert mo na lang sa c++ na language..

int main()
{
int option;
printf("Options\n");
printf("1: if you are a boy\n");
printf("2: if you are a girl\n");
printf("3: if you are a male\n");
printf("4: if you are a female\n");
printf("Select option: ");
scanf(" %d", &option);

switch(option)
{
case 1: printf("Boy");
//Output if 1 is selected: Boy
break;

case 2: printf("Girl");
//Output if 2 is selected: Girl
break;

case 3: printf("Male");
//Output if 3 is selected: Male
break;

case 4: printf("Female);
//Output if 4 is selected: Female
break;

default: printf("Invalid Input!");
//Output if key entered not between 1 to 4: Invalid Input!
break;
}
return 0;

}

marunong ka po bag mag gawa ng codes for matlab ..?
 
Status
Not open for further replies.

About this Thread

  • 6
    Replies
  • 866
    Views
  • 6
    Participants
Last reply from:
calvinpage20

Online now

Members online
655
Guests online
4,353
Total visitors
5,008

Forum statistics

Threads
2,349,615
Posts
29,363,405
Members
1,091,201
Latest member
Anthonyyy23
Back
Top