1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
nignag [31]
3 years ago
7

Write a for loop to print all elements in courseGrades, following each element with a space (including the last). Print forwards

, then backwards. End each loop with a newline. Ex: If courseGrades = {7, 9, 11, 10}, print:Write a for loop to print all elements in courseGrades, following each element with a space (including the last). Print forwards, then backwards. End each loop with a newline. Ex: If courseGrades = {7, 9, 11, 10}, print:
Computers and Technology
1 answer:
siniylev [52]3 years ago
3 0

C program for printing elements in a format

#include <stdio.h>

int main() //driver function

{

int courseGrades[100];

int n,i;

printf("How much grades points were there");

scanf("%d",&n);

printf("Enter grade elements\n"); //Taking input from user

for(i=0;i<n;i++)

{

scanf("%d",&courseGrades[i]);

}

printf("Elements are \n"); //printing the elements that user entered

for(i=0;i<n;i++)

{

printf("%d",courseGrades[i]);

}

printf("\nPrinting elements in the format\n");

for(i=0;i<n;i++) /*loop for the first line,\t is used for horizontal spacing*/

{

printf(" %d\t",courseGrades[i]);  

}

printf("\n"); /*\n is used to get the new line*/

for(i=n-1;i>=0;i--) /*loop for printing the input in reverse order*/

{

printf("%d \t",courseGrades[i]);  

}

return 0;

}

<u>Output</u>

How much grades points were there  4 Enter grade elements {7,9,11,10}

Elements are

791110

Printing elements in the format

7  9  11  10

10  11  9  7  

You might be interested in
They are correct? thank you!
vredina [299]

Answer:

<em>Yes</em><em> </em><em>they</em><em> </em><em>are</em><em> </em><em>correct</em><em>.</em><em> </em><em>welcome</em><em>.</em><em>.</em><em>.</em><em>.</em>

8 0
3 years ago
97. How many bits is a ki obyte?<br> a. 1000<br> b. 1024<br> c. 8192<br> d. 8124<br> 5
Basile [38]

Answer:

b

1024

is the correct answer

6 0
3 years ago
Read 2 more answers
Risk is the product of what variables?<br><br> Threat<br><br> Value of asset<br><br> Vulnerability
Fiesta28 [93]
The answer should be:Vulnerability..
6 0
3 years ago
Explain what a wiki is and list its advantages.
Drupady [299]

Explanation:

Wikis are defined as a form of a website or web page or a database where the users can work on the data, they can even add or edit the data. Wikis use a very quick as well as a easy syntax that allows the users to format the text and create various links between the pages. The users need internet browsers for that.

One of the main advantage of wiki is that it provides ability to collaborate asynchronously, and also without  time constraints.Besides it also provides a beneficial function of something. It is free and not expensive.

5 0
3 years ago
Which ipv4 ip class provides for 126 unique networks, each having up to 16,777,214 hosts?
Sliva [168]
Class A.






----------------------------------------
3 0
3 years ago
Other questions:
  • Which of the following commands uses correct syntax for matching the patterns bunk or bank at the end of a line of text?
    5·1 answer
  • Please Help Me!!! 40 Points!! Match the correct definition to each term
    14·1 answer
  • Your recovery/recycling machine has r-502 refrigerant in it. you now have to recover refrigerant from a unit with r-22. what mus
    12·1 answer
  • Physical parts of components of a computer system is called
    9·1 answer
  • "what is the #1 resource used when researching a product online?"
    5·1 answer
  • 45, 78, 23, 12, 63, 90, 38, 56, 88, 15 Using the sequential search as described in this chapter, how many comparisons are requir
    10·1 answer
  • The sun emits invisible _____&gt; A) electromagnetic waves B) Waves C) Radiation D) Wavelength E) Ultraviolet Light
    8·1 answer
  • Which of the following is adoptable in Mindanao only?​
    5·1 answer
  • Write a new version (called map2) of the map function which operates on two lists. Your function should accept three parameters,
    15·1 answer
  • One advantage of a PAN​
    10·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!