Question

Instructions Now, you introducing a for loop. This loop runs a pre-determined number of times. The for loop initiates the

And here is the code: Unit 2 Guided Practice 7.c #include <stdio.h> 1 main) 3E { 2 int counter; 4 for (counter= 1; counter<=

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

FLOWGORITHM FLOWCHART:

(Untitled)*Flowgorithm File Edit Program Tools Help Main Main Integer i Next i 1 to 10 Done Output i End EN X

CODE:

#include <stdio.h>

int main(){
   int i;
   for(i = 1; i <= 10; i++){
      printf("%d\n", i);
   }
   return 0;
}

CODE SCREENSHOT:

File Edit Search View Project Execute Tools AStyle Window Help (globals) Project Classes Debug counter.c #include <stdio.h> 1

CODE OUTPUT:

C:AUsers\Shubham\Desktop\counter.exe 1 2 3 4 5 6 7 8 9 10 Process exited after 0.1553 seconds with return value 0 Press any k

Add a comment
Know the answer?
Add Answer to:
Instructions Now, you introducing a "for" loop. This loop runs a pre-determined number of times. The...
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
  • Instructions This program calculates the square root, cube root, and fourth root for the numbers 10...

    Instructions This program calculates the square root, cube root, and fourth root for the numbers 10 through 25. It demonstrates the sqrt() and pow() functions. Here is the code: Unit 5 Guided Practice 3.C 1 /* Filename: CHAP22-6.C Square, cube, and fourth root problem */ 4 5 #include <stdio.h> #include <math.h> 9 9 main() { int num; double square, cube, fourth; /*Variables must be float or double */ 12 14 for( num = 10; num <= 25; num++) { square...

  • Finish the following program which adds up all integers from 0 to the user's given number inclusively using a While Loop

    // Finish the following program which adds up all integers from 0 to// the user's given number inclusively using a While Loop. The total should be// assigned to the variable 'total'.#includeusing namespace std;int main() {int number;int total = 0;int counter = 0; //initialize the variable// user enters a numbercout << "Enter a positive integer to find the summation of ";cout << "all numbers from 0 to the given number up to 100." << endl;cin >> number;// check for invalid user...

  • 3. A tor loop is useful when you know in advance the number of iterations to...

    3. A tor loop is useful when you know in advance the number of iterations to be executed. The tor loop consists of three parts each of which is separated by a semicolon (:). The first part is initialization of the variable for iteration, the second part is a test of the iteration variable and if this test fails, the loop is finished. The third part is a counter for the iteration variable. A block can be followed after the...

  • Please do both parts (in Java); thanks! An Armstrong number of three digits is an integer...

    Please do both parts (in Java); thanks! An Armstrong number of three digits is an integer such that the sum of the cubes of its digits is equal to the number itself. For example, 371 is an Armstrong number since 3^3 + 7^3 + 1^3 = 371. Draw the flowchart and write a Java code to find ALL Armstrong number in the range of 0 and 999. You should write your code in two ways: (Yes as if you are...

  • Hello, I need help understanding what happens to the value in each loop. I missed a...

    Hello, I need help understanding what happens to the value in each loop. I missed a lot of class so I need help. I decoded the final message but I'm supposed to fill in tables for each function. Homework 4: Program Trace Check out this “instructional” video on decoding strings - http://www.youtube.com/watch?v=zdA__2tKoIU Determine the output of the program below. You will receive no credit for a submission that shows no work. You must make variable tables and show how the...

  • 1. What is the output when you run printIn()? public static void main(String[] args) { if...

    1. What is the output when you run printIn()? public static void main(String[] args) { if (true) { int num = 1; if (num > 0) { num++; } } int num = 1; addOne(num); num = num - 1 System.out.println(num); } public void addOne(int num) { num = num + 1; } 2. When creating an array for primitive data types, the default values are: a. Numeric type b. Char type c. Boolean type d. String type e. Float...

  • Assignment • No variables declared after you start writing code, must be declared at the top....

    Assignment • No variables declared after you start writing code, must be declared at the top. • Reuse all the variables from the first half in the second half, do not make up new variable names. • You code must be properly formatted. • You must use the code provided and variables names provided and not add any more variables to your code. • No for(int I = 0; … no declaring variables except at top of code. • You...

  • Flow CHART READ THIS PROGRAM OVER SEVERAL TIMES vI: Flow chart the problem that follows. DO...

    Flow CHART READ THIS PROGRAM OVER SEVERAL TIMES vI: Flow chart the problem that follows. DO NOT WRITE THE CODE. Your grade will depend on how well you show cosmology the behavior of space through time is given by a function called the scale factor r(t). The variable,t, i behaviors of the scale factor depending upon estimates of the amount of matter in the universe. The amount of rogrom will start by asking the user for the epsilon value only...

  • 1. Suppose you wrote a program that reads data from cin. You are now required to...

    1. Suppose you wrote a program that reads data from cin. You are now required to reimplement it so that you can read data from a file. You are considering the following changes. I. Declare an ifstream variable in_file II. Replace all occurrences of cin with in_file III. Replace all occurrences of > > and get_line with the appropriate operations for ifstream objects What changes do you need to make? I, II, and III II and III I and III...

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