Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Can someone check my work for me ,my program wont run

  1. Feb 22, 2005 #1
    #include<stdio.h>
    main()
    {
    int zipcode,numdem,numrep,sum ;
    double perdem, perrep;

    While(zipcode!= -1111){
    printf("please enter zipcode");
    scanf("%d",&zipcode);
    printf("please enter numdem)'
    scanf("%d",&numdem);
    printf("please enter numrep");
    scanf("%d",&numrep);
    zipcode, zipcoderep;max amountregisvoters
    sum=numdem+numrep;district=district+1
    perdem=(dem/totalregvoters)*100;
    perrep=(rep/totalregvoters)*100;
    if(dem<rep)
    printf("there are more republicans");
    if(dem>rep)
    printf("there are more democrats");
    if(dem==rep)
    printf("the number of democrats and republicans are the same");
    printf("\n\n\n\n\n");
    }
    return0
    }
     
    Last edited: Feb 22, 2005
  2. jcsd
  3. Feb 22, 2005 #2

    NateTG

    User Avatar
    Science Advisor
    Homework Helper

    When you're posting code, indent and use the
    Code (Text):
     tags.
    You could start by making sure that:
    1. The open and close quotes for everything are where you want them to be.
    2. There are semicolons in all appropriate places.

    Both of these are common and, in your example rather obvious issues.

    For example:
    [QUOTE]
    printf("please enter numdem)'
    [/QUOTE]

    Moreover, what is this line supposed to do?
    [QUOTE]
    zipcode, zipcoderep;max amountregisvoters
    [/QUOTE]
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?



Similar Discussions: Can someone check my work for me ,my program wont run
  1. Mozilla wont run (Replies: 4)

Loading...