Question

C program- using visual studio code. Write a program that asks for an integer and then...

C program- using visual studio code.

Write a program that asks for an integer and then prints all the alternative integers from (and including) that value up to (and including) a value larger by 20. (That is, if the input is 5, the output runs from 5 to 25.) Be sure to separate each output value by a space or tab

Homework Answers

Answer #1

c program and output is attached as screenshot

------------------------------------------------------------------------

#include <stdio.h>

int main()
{
int n,i;
printf("enter interger\n");
  
scanf("%d",&n); // enter any interger

for(i=n;i<=n+20;i+=2) loop print every alternate interger
printf("%d\t",i);
  

return 0;
}

Know the answer?
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
Similar Questions
Please Write code in visual studio Roman Numeral Converter Write a program that asks the user...
Please Write code in visual studio Roman Numeral Converter Write a program that asks the user to enter a number within the range of 1 through 10. Use a switch statement to display the Roman numeral version of that number. Input Validation: Decide how the program should handle an input that is less then 1 or greater than 10.
in c++ Write a C++ program that asks the user to enter an integer number and...
in c++ Write a C++ program that asks the user to enter an integer number and prints it back "vertically" to the screen. Use recursion in your solution. As an example of how the program will work: Please enter an integer: 12345 The integer you entered will print vertically as: 1 2 3 4 5
This is for programming using visual basic on visual studio. Write code to: a) Place the...
This is for programming using visual basic on visual studio. Write code to: a) Place the contents of txtQuantity into intQuantity. You should be able to determine what types of objects they are based upon their names. b) Using the objects, what value would be placed into intQuantity if the value of txtQuantity is 3.5?
Write a program that asks the user of a positive integer value. The program should use...
Write a program that asks the user of a positive integer value. The program should use a loop to get the sum of all the integers from 1 up to the number entered. For example, if the user enters 50, the loop will find the sum of 1,2,3,4,…,50. using namespace std;
Write a program in C++ coding that asks the user to input an integer between 25...
Write a program in C++ coding that asks the user to input an integer between 25 and 50, inclusive. Utilize a WHILE loop to test for INVALID input. If the input is INVALID, the loop will repeat, and ask the user to try again. The pseudocode looks like this: Prompt user to input an integer between 25 and 50 Accept the input from the user Test for invalid input (HINT: use a while loop and the OR operator with 2...
c++ 19.36 LAB: Output values below an amount - functions Write a program that first gets...
c++ 19.36 LAB: Output values below an amount - functions Write a program that first gets a list of integers from input. The input begins with an integer indicating the number of integers that follow. Then, get the last value from the input, and output all integers less than or equal to that value. Ex: If the input is: 5 50 60 140 200 75 100 the output is: 50 60 75 The 5 indicates that there are five integers...
Write a program that asks the user to input an integer between 25 and 50, inclusive....
Write a program that asks the user to input an integer between 25 and 50, inclusive. Utilize a WHILE loop to test for INVALID input. If the input is INVALID, the loop will repeat, and ask the user to try again. The pseudocode looks like this: Prompt user to input an integer between 25 and 50 Accept the input from the user Test for invalid input (HINT: use a while loop and the OR operator with 2 relational expressions. You...
February 18 is a special date for the CCC this year. Write a program that asks...
February 18 is a special date for the CCC this year. Write a program that asks the user for a numerical month and numerical day of the month and then determines whether that date occurs before, after, or on February 18. If the date occurs before February 18, output the word Before. If the date occurs after February 18, output the word After. If the date is February 18, output the word Special. Input The input consists of two integers...
Program C++ (use visual studio) Q1. What default copy constructor does the compiler insert in the...
Program C++ (use visual studio) Q1. What default copy constructor does the compiler insert in the following class? class Student { string name; string id; double grade; }; =========================== Q2 .What is the factor transfer method used when the f() function is called from? void f(int n[]); int main() { int m[3]= {1, 2, 3}; f(m); } ================================== Q3. Write a program that produces a bigger() with a prototype as shown below and outputs a large value by inputting two...
In Coral,write a program that reads a list of 10 integers and outputs those Integers in...
In Coral,write a program that reads a list of 10 integers and outputs those Integers in Reverse. For coding Simplicity, follow each output integer by a space, including the last one. Then, output a new line. Example if the input is 2 4 6 8 10 12 14 16 18 20, the output is: 20 18 16 14 12 10 8 6 4 2 to achieve above first read the integers into an array. Then output the array in reverse
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT