Thread: **need help with a program in C

  1. #1
    Registered User
    Join Date
    Nov 2018

    Unhappy **need help with a program in C

    I need to rite a program to output a P6 ppm format image of an international flag(France flag and Jamaican flag). So far this is what I have but I feel like it is completely wrong. If anyone could help that would be great!
    **need help with a program in C-screen-shot-2018-11-27-3-32-56-pm-jpg

    These are the guidelines I need to follow:
    -The user will enter the width of the flag up to 1000 pixels and you will determine the appropriate height of the flag from its aspect ratio
    -Output a flag composed of 3 vertical or 3 horizontal stripes, such as a flag from France, Hungary, or Sierra Leone. Your code should include at least one function.
    -in addiction to your program, your program should output a flag composed of a "cross" such as a flag from Denmark, Iceland, or the Dominican Republic. Your code should include at least two functions. Your program should also provide a user menu so that the user can select one flag or the other, based on the flag's country of origin
    your program should output a flag composed of diagonals or triangles such as a flag from the Czech Republic, Jamaica, or Kuwait. The user interface should now include 4 options: 3 flag options (one from each grade level) and an option to exit the program
    Last edited by maddypolke; 11-27-2018 at 02:37 PM.

  2. #2
    Registered User
    Join Date
    May 2009
    Read up on functions; it is not normal to have a function inside the main function.

    Functions in C -

    Tim S.
    "...a computer is a stupid machine with the ability to do incredibly smart things, while computer programmers are smart people with the ability to do incredibly stupid things. They are,in short, a perfect match.." Bill Bryson

  3. #3
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    The edge of the known universe
    Next time, put your code between [code][/code] tags.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 5
    Last Post: 03-15-2016, 03:29 PM
  2. Replies: 2
    Last Post: 09-09-2014, 02:36 PM
  3. Replies: 2
    Last Post: 12-11-2012, 12:25 AM
  4. Replies: 1
    Last Post: 03-03-2009, 04:47 PM
  5. Replies: 18
    Last Post: 11-13-2006, 01:11 PM

Tags for this Thread