Thread: C Programming

  1. #1
    Registered User
    Join Date
    Jan 2017
    Posts
    2

    C Programming

    Hi All

    I am a beginner to C Programming, as a Networking student, im struggling with some of the programming for university module, using an application called Code-Block. I have been struggling with some of the basic programming and wonder if anyone can give me any advise or pointer on where to get things started.


    Write a program to read three numbers and to output the median value. The median of three numbers is the number whose value is between the other two. For example, the median of 3, 8, and 4 is the value 4. (This is not the average, which would be 5). Note that the median of 3, 8 and 3 is the value 3.


    Write a program to read a coursework mark between 0 and 100. Assign a letter grade of ‘A’ for a mark of 70 or above; ‘B’ for a mark of 60 to 69; ‘C’ for a mark of 50-59; ‘D’ for a mark of 40-49 and ‘F’ for a mark below 40. Output this grade or an error message for a mark below 0 or above 100.


    Write a program to read a series of positive and negative integer values terminated by a 0, and outputs the length of the longest sequence of negative values. For example: for the following input:

    5 6 7 -4 -5 9 1 6 7 8 -1 5 6 -4 -1 -7 -9 7 -4 -5 8 7 0

    Output: the longest negative sequence is of length 4

    Corresponding to the sequence -4 -1 -7 -9 (not required on output).
    [/SIZE][/FONT]

    Any help would be much appreciated

    Regards

    Ollie

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    Start small, compile and test often.
    A development process

    Each new program begins with reading the input and just printing it back out.
    Until that works, the rest of the assignments are out of reach.
    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: 2
    Last Post: 09-11-2012, 01:03 AM
  2. Replies: 4
    Last Post: 12-11-2011, 04:25 PM
  3. small programming job VCPP / Object Oriented Programming
    By calgonite in forum Projects and Job Recruitment
    Replies: 10
    Last Post: 01-04-2006, 11:48 PM
  4. Total newb to programming here... Question about the many programming languages. Ty!
    By tsubotakid1 in forum A Brief History of Cprogramming.com
    Replies: 11
    Last Post: 10-05-2003, 10:32 AM

Tags for this Thread