🔒 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.

Similar threads

About this Thread

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

Trending Topics

Online now

Members online
1,004
Guests online
1,223
Total visitors
2,227

Forum statistics

Threads
2,273,906
Posts
28,952,291
Members
1,234,983
Latest member
Ryu Kali
Back
Top