Question

Write a complete C program that generate the following sequence of numbers in two ways. First,...

Write a complete C program that generate the following sequence of numbers in two ways. First, the sequence of numbers should be made using a WHILE LOOP, then a DO-WHILE LOOP.

19, 15, 11, 7, 3, -1, -5, -9

0 0
Add a comment Improve this question Transcribed image text
Answer #1

esc to close source code #include<stdio.h> 2 int main() 4 int n-19 5 clrscr; 6 printf(n The sequence number are n); while(n

source code 1 #include<stdio.h> 2 int main() 4 int n-19, 5 cirscr; 6 printf(In The sequence number are n) 7 do printf(%d n

Add a comment
Know the answer?
Add Answer to:
Write a complete C program that generate the following sequence of numbers in two ways. First,...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Below are a list of sequences of numbers. Your job is to program each sequence with...

    Below are a list of sequences of numbers. Your job is to program each sequence with any loop of your preference (while, for, do/while). I want the code to output the sequence provided and the next number in the sequence (you can output more but there is 1 sequence that may only have 1 number after). Each sequence should be in the same main in one .cpp file. . Please order and notate each sequence in your output –. The...

  • Generate the following sequence using for loop. it is the same as the previous sequence but...

    Generate the following sequence using for loop. it is the same as the previous sequence but 23 is missed.    3 7 11 15 19 27 31 35 again, use the for loop

  • In this exercise, write a complete Java program that reads integer numbers from the user until...

    In this exercise, write a complete Java program that reads integer numbers from the user until a negative value is entered. It should then output the average of the numbers, not including the negative number. If no non-negative values are entered, the program should issue an error message. You are required to use a do-while loop to solve this problem. Solutions that do not use a do-while loop will be given a zero. Make sure to add appropriate comments to...

  • PYTHON PROGRAMMING: DO NOT USE INPUT FUNCTION, use sys.argv Write a program that generates two random...

    PYTHON PROGRAMMING: DO NOT USE INPUT FUNCTION, use sys.argv Write a program that generates two random integer numbers between 1 and 100. Then, print out the numbers between the two randomly generated ones using a while loop. The output is shown below. Output: a) start:4, end:14 4 5 6 7 8 9 10 11 12 13 14 b) start:15, end:20 15 16 17 18 19 20

  • Write a SQL Program to print out the first 10 numbers of the following sequence F(n)....

    Write a SQL Program to print out the first 10 numbers of the following sequence F(n). F(1) = 3, F(2)=5. F(n)=3*F(n-1) –2*F(n-2). E.g., F(3) = 3*F(2) – 2* F(1) = 3*5–2*3=15-6=9 Your program will print out F(1), F(2),..., F(10). Hint: use three variables, the first storing F(n), the second storing F(n-1), and the third storing F(n-2). Think of how to compute the first variable from the other two and how to update the other two variables in each iteration

  • c++ class, coding using code blocker MinilabLoopLogic The program: You are to write a program called...

    c++ class, coding using code blocker MinilabLoopLogic The program: You are to write a program called MinilabLoopLogic which does the following Asks the user to enter 2 integers (can be one prompt or two) Gets and stores the ints Explains that the program will generate all integers that are between the numbers and are divisible by a third integer . e Asks the user for the number they should be divisible by Gets and stores that int Since 0 will...

  • C# Programming 1-Write a program that generates the following sequence using while loop 2, 3,6,11, 18,...

    C# Programming 1-Write a program that generates the following sequence using while loop 2, 3,6,11, 18, 27,... 102 2-A. Repeat 1 using for loop. B. Modify your program in A to skip 27 from that sequence. C. Modify your program in A by using break statement to stop generating the sequence if the generated number is greater than 30 3. Using loops, find the value of f(7) given: fO)-4, f(n) 2f(n-1)+4, where n is Natural number Hint: f(1)-2f(0)+4-2 4+4-12 f12)-2f(1)+4-...

  • This is a C program. please help me to write a pseudocode of the program ....

    This is a C program. please help me to write a pseudocode of the program . also, I want the program In a do...while loop and the screen output should look like in the picture. please help me. 3.1. Write a program that asks the user to continue to enter two numbers (at a time). For each pair of numbers entered, the program calculates the product of those two numbers, and then accumulate that product. For each pair of numbers...

  • use Rstudio 4. Write a for() loop that prints the first four numbers of this sequence:...

    use Rstudio 4. Write a for() loop that prints the first four numbers of this sequence: x 〈-c(7, 4, 3, 8, 9, 25)

  • Write a C program that reads a sequence of numbers and display a message 1. The...

    Write a C program that reads a sequence of numbers and display a message 1. The numbers a re red from the standard input. 2. The first number is the length of the sequence (n) followed by n numbers. 3. If n is 0 or negative, the program displays the message "Error_1" followed 4. If the length is shorter than n, it displays "Error_2" followed by a new line 5. The program inspects the list and display one of the...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT