473,406 Members | 2,705 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

what is wrong in this codes?

this is the codes:


Expand|Select|Wrap|Line Numbers
  1. #include<stdio.h>
  2. #include<stdlib.h>
  3. int main()
  4. {
  5. char option,pin,transaction;
  6. int deposit, withdraw;
  7. option='0';
  8.  
  9.  
  10.  
  11. printf("WELCOME TO SAMUEL'S BANK\n");
  12. printf("------------------------------\n\n");
  13. printf("Main Menu\n");
  14. printf("------------------------------\n");
  15. printf("1)Enter Pin #\n");
  16. printf("2)Exit\n");
  17. printf("------------------------------\n\n");
  18. scanf("%c", &option);
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25. {
  26. system ("cls");
  27. printf("Pin Number Verification\n");
  28. printf("------------------------------\n\n");
  29. printf("Please enter your pin number: ");
  30. scanf("%s", &pin);
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38. //if(inputfile ==NULL)
  39. {
  40. printf("Unable to open input file\n");
  41. }
  42. return 1;
  43.  
  44.  
  45. system ("cls"); 
  46. printf("Transactions\n");
  47. printf("------------------------------\n");
  48. printf("1)Deposit\n2)Withdraw\n3)Statement\n4)Exit \n");
  49. printf("------------------------------\n");
  50. scanf("%s",&transaction);
  51. }
  52.  
  53.  
  54.  
  55.  
  56. if (transaction =='1')
  57.  
  58. {
  59. system ("cls");
  60. printf("Deposit\n");
  61. printf("------------------------------\n\n");
  62. printf("Please enter the amount of money you would like to deposit: ");
  63. scanf("%d", &deposit);
  64. }
  65.  
  66. if (transaction =='2')
  67.  
  68. {
  69. system ("cls");
  70. printf("Withdraw\n");
  71. printf("------------------------------\n\n");
  72. printf("Please enter the amount of money you would like to withdraw: ");
  73. scanf("%d", &withdraw);
  74. }
  75.  
  76. if (transaction=='3')
  77.  
  78. {
  79. system ("cls");
  80. printf("Statement\n");
  81. printf("------------------------------\n\n");
  82. }
  83.  
  84.  
  85.  
  86.  
  87.  
  88.  
  89.  
  90. return 0;
  91.  
  92.  
  93. }




when i will start to run it . the only mistake is this part:



//if(inputfile ==NULL)



that's the only mistake !!!
please help me
thanks !
Mar 10 '10 #1
3 1409
Banfa
9,065 Expert Mod 8TB
It looks to me like most of those blank lines in your source listing should contain something, in many cases function headers I suspect and possibly some control structures.

Where did you copy it from?
Mar 10 '10 #2
i copy it here at bytes.com
Mar 10 '10 #3
Banfa
9,065 Expert Mod 8TB
In that case i suggest that you start again and write the code with the functionality that you want it to have rather than copying a half baked piece of code some somewhere else that you don't understand.
Mar 10 '10 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: neutrinman | last post by:
I cannot find out why the following code generates the error: Traceback (most recent call last): File "D:/a/Utilities/python/ptyhon22/test.py", line 97, in ? main() File...
6
by: Zhang Weiwu | last post by:
Hello. I am working with a php software project, in it (www.egroupware.org) Chinese simplified locate is "zh" while Traditional Chinese "tw". I wish to send correct language attribute in http...
5
by: Jepsensen | last post by:
Dear Everybody. I got a problem with my cpp code. I'm trying to calculate a very simple Discrete Cosine Transform (DCT), but my c++ code seams to calculate a wrong result. I have just started...
2
by: chenboston | last post by:
I am learning STL and write my own simple codes to test the examples. When I compile (g++ -c -o A.o A.C) I got "A.h:13: error: parse error before `<' token". This must be a simple problem, just...
39
by: windandwaves | last post by:
Hi Folk I have to store up to eight boolean bits of information about an item in my database. e.g. with restaurant drive-through facility yellow windows
8
by: nytimescnn | last post by:
I've read some discuession about lock() for thread-safe. I am wondering what will be the differce between below two code segment? Code 1: class A { private static Object padlock = new...
5
by: Jens | last post by:
Hello, I have been looking for some C-code which listens on a user-defined port for incoming data traffic. When data is received, the data is written to a file. I found some C-code (server)...
7
by: Meal | last post by:
The last line of the following codes makes the program crash. I cannot debug into the codes. It looks that I cannot use the dynamic_cast, but why? The cout shows that the node is DOM element node....
13
blazedaces
by: blazedaces | last post by:
Hey guys, how's it going today? So basically I have a program that uses hotbits (a real online random number generator based off radioactive decay) to produce truly random alphanumeric codes (Note:...
5
by: =?GB2312?B?17/HvyBaaHVvLCBRaWFuZw==?= | last post by:
Hi, I would like to have someone comments on what's the best practice defining error codes in C. Here's what I think: solution A: using enum pros: type safe. better for debug (some debugger...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.