🔒 Closed Saang lines po nagkamali? programming quiz!

Status
Not open for further replies.
Puro syntax error..Aralin mo lang syntax..mas matututo ka kung makabisado mo syntax..Mas mahirap problem solving kesa syntax analysis.. Good luck!
 
C:
#include <stdio.h>
int main ();
{
 int bal = 10000;
 int pin, choice deposit, withdraw;
printf("enter your four digit pin: ");
 scanf("%d, &pin");
 while (pin == 9999)
 {
 printf("welcome please choose an action: \n");
 printf("1 - balance inquiry\n");
 printf("2 - withdraw\n");
 printf("3 - deposit\n");
 printf("4 - exit\n");
 scanf("%d", &choice);
 if(choice == 1)
 }
 printf("\n your available balance is: %d", bal);
 break:
 {
 else if(choice == 2)
}
 printf("\n enter amount to withdraw: ");
 scanf("%d", &withdraw);
 while (withdraw <== bal)
 {
 bal = bal - withdraw;
 printf("\n withdraw successful, your new balance is: %d \n", $bal);
 break;
 }
 break;
 {
 else if(choice == 3)
 {
 printf("\namount to be deposited: ");
 scanf("%d". &deposit);
 bal = bal + deposit;
 printf("\n your new balance is: %d \n", bal);
 break;
 }
 else if(choice == 4)
 {
 break:
 }
 {
}
 
Hindi ako magaling sa C eh pero try mo yan kung nafix ko


[CODE lang="c" title="Answer?"]#include <stdio.h>
int main() {
int bal = 10000;
int pin, choice, deposit, withdraw;
printf("enter your four digit pin: ");
scanf("%d", &pin);
while (pin == 9999)
{
printf("welcome please choose an action: \n");
printf("1 - balance inquiry\n");
printf("2 - withdraw\n");
printf("3 - deposit\n");
printf("4 - exit\n");
scanf("%d", &choice);
if(choice == 1)
{
printf("\n your available balance is: %d", bal);
break;
}
else if(choice == 2)
{
printf("\n enter amount to withdraw: ");
scanf("%d", &withdraw);
while (withdraw == bal)
{
bal = bal - withdraw;
printf("\n withdraw successful, your new balance is: %d \n", bal);
break;
}
}
else if(choice == 3)
{
printf("\n amount to be deposited: ");
scanf("%d", &deposit);
bal = bal + deposit;
printf("\n your new balance is: %d \n", bal);
break;
}
else if(choice == 4)
{
break;
}
}
}[/CODE]
 
Status
Not open for further replies.

About this Thread

  • 11
    Replies
  • 512
    Views
  • 8
    Participants
Last reply from:
iloverhaine

Trending Topics

Online now

Members online
1,165
Guests online
5,356
Total visitors
6,521

Forum statistics

Threads
2,354,500
Posts
29,383,900
Members
1,079,468
Latest member
bgzin99
Back
Top