Thread: need help with a program

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Feb 2012
    Posts
    116

    need help with a program

    Hi everyone. A bit stuck on a program. Im trying to make the basic structure of a prgram but it doesnt seem to work. Can anyone check it and tell me what im doing wrong? Once its working I intend to start putting some meat onto the program but first want the basic shell working:


    Code:
    #include<stdio.h>
    void 1();
    void 2();
    void main()
    {
    char 3;
    char repeat;
    do
    {
    printf("Please press 'b' if you have a something and you wish to do\n or\n please press 'v' if you have something else you wish to do ");
    scanf("%c",&3);
    if (3='b')
    {
    2();
    }
    else
    {
    if (3='v')
    {
    1();
    }
    printf("Do you wish to repeat the program? (y/n)");
    scanf("%c",&repeat);
    }
    while(repeat=='y');
    }
     
     
     
     
     
    void 1()
    {
    
    printf("it works");
    }
     
     
     
     
    void 2()
    {
    
    printf("it works");
    }
    
    due to time constraints Im not looking to increase the functionality of the code, I just want it to work. If we ca get it to print "it works" when I choose that function then that'd be great. i know there are issues with this program but dont have time to make it better, just need a basic functioning program. thanks for your help

    also, as its an assignment ive had to change the details, so that I can see the principles and techniques without risking getting done for plagurism or something.

    I edited important names and replaced them with 1, 2 or 3 so please bare in minf they arent actually 1, 2 and 3 in my program they are sensibly named variables and functions
    Last edited by David_Baratheon; 02-01-2012 at 04:26 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 13
    Last Post: 11-03-2010, 12:45 PM
  2. Help converting array program to link list program
    By hsmith1976 in forum C++ Programming
    Replies: 0
    Last Post: 02-14-2010, 09:50 PM
  3. Replies: 1
    Last Post: 03-03-2009, 04:47 PM
  4. Replies: 5
    Last Post: 08-16-2007, 11:43 PM
  5. Replies: 18
    Last Post: 11-13-2006, 01:11 PM