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
Study and compare the tables and draw conclusions.
SSSSS [86.1K]
Need the tables for an answer
5 0
3 years ago
Shira’s Shoes sold 875,000 pairs of sandals in June, which was 70% of the total number of shoes sold. How many shoes did the com
Angelina_Jolie [31]

Explanation:

Emily solved for a part when she should have solved for the whole. 875,000 should be the numerator of the equivalent ratio. 70 x 12,500 is 875,000. So the answer is 100 x 12,500 which is 1,250,000.

8 0
2 years ago
Read 2 more answers
पुजवय<br>शब्दस्य<br>विरूदायक​
statuscvo [17]

Answer:

के?

Explanation:

5 0
3 years ago
How does the dns help the world wide web scale so that billions of users can access billions of web pages?.
valentina_108 [34]

Answer:

domain name systems allow web users to choose where they want to go and to have many different sites

8 0
2 years ago
Why do we need to send emails
DiKsa [7]

Answer:

email is the easier way of communicating and fast

5 0
3 years ago
Other questions:
  • Which sparkline type is best for displaying trends in data changes over time?
    11·1 answer
  • What is PHP language
    12·1 answer
  • What is the purpose for the refresh button?
    10·2 answers
  • Mihaela I. Croitoru – Utilizarea calculatorului personal Microsoft Word dau coroana
    14·1 answer
  • Which act requires that financial institutions must provide a privacy notice to each consumer that explains what data about the
    12·1 answer
  • Stuart wants to delete some text from a slide. What should Stuart do?
    8·1 answer
  • What is the largest value that can be represented by 6 binary digits? .
    5·1 answer
  • Many web pages use a <br> structure to define an area of focus
    13·1 answer
  • Which of these are examples of an access control system? Check all that apply.
    7·1 answer
  • What is Utility Software ? Name any two utility programs. <br>​
    15·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!