Thread: Help!!! Assignment due tomorrow

  1. #1
    Registered User
    Join Date
    Nov 2016
    Posts
    2

    Help!!! Assignment due tomorrow

    I need help for an assignment due tom! I did 7 all i need to do is these three more but im too tired HAHA.

    1. Write a program that determines the combinations of x, y, and z with each value ranging from -500to +500 that would make the following expression true: 2x – 3y >= 5z

    2. Write a program that will take in a non-negative integer. If the non-negative integer is a primenumber, ask for another number n. Then, generate the next n prime numbers after the given primenumber. If the number is not prime, just indicate “Not Prime”. For example, if input non-negativenumber is 7 and n is 4, then the program should display: 11 13 17 19

    3. Write a program that will display the following pattern given n, where n represents the number oflines and the width of the pattern to be generated. Assume that n will be a positive odd integer thatwill at least be 3. Your program should follow the skeleton below:

  2. #2
    Registered User
    Join Date
    Oct 2006
    Posts
    3,445
    What have you tried so far?
    What can this strange device be?
    When I touch it, it gives forth a sound
    It's got wires that vibrate and give music
    What can this thing be that I found?

  3. #3
    Registered User
    Join Date
    Nov 2016
    Posts
    2
    I did the first one
    Code:
    #include <stdio.h>
    int main()
    {
    	int x,
    		y,
    		z;
    for(z=-500; z<=500;z++)	
    {
    	for(y=-500;y<=500;y++)
    	{
    		for(x=-500; x<=500; x++)
    		{
    			if(2*x - 3*y >= 5*z)
    			{
    				printf("x = %d ,y = %d, z = %d\n",x,y,z);
    			}
    		}
    	}	
    }
    return 0;
    }
    but im still having a hard time on the 2nd and 3rd

  4. #4
    Registered User
    Join Date
    Jun 2011
    Posts
    4,513
    What exactly are the problems you are having with the other ones?

    Show your work.
    Ask smart questions.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Need C Programmer to Program and assignment by tomorrow wed April 13
    By sellahremy in forum Projects and Job Recruitment
    Replies: 10
    Last Post: 04-14-2011, 02:38 PM
  2. project assignment due tomorrow
    By parastar in forum C Programming
    Replies: 4
    Last Post: 01-23-2011, 09:12 AM
  3. help assignment due tomorrow
    By wildiv in forum C Programming
    Replies: 6
    Last Post: 01-27-2010, 08:38 PM
  4. please help..linked list homework assignment due tomorrow..
    By rocketman03 in forum C Programming
    Replies: 2
    Last Post: 11-23-2008, 06:32 PM

Tags for this Thread