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
Which tables and fields would you access to determine which book titles have been purchased by a customer and when the order shi
enyata [817]

Answer:

To determine which book titles have been purchased by a customer and when the order shipped the following tables and fields would be used.

Table:      

  • CUSTOMERS

Fields

  • Customerno

Table

  • ORDERS

Fields:

  • Orderno
  • Shipdate
  • Customerno

Table:

  • ORDERITEMS

Fields:

  • Orderno

Table:

  • BOOKS

Fields

  • isbn
  • title

BOOKS table contains field like title of the books, so this will help in finding which book titles have been purchased.

CUSTOMERS table keeps information about customers that purchasing an ordering the books. The customerno uniquely identifies each customer so that the order information can be found using the customerno of a specific customer.

ORDERITEMS keeps information about orders via orderno

ORDERS table will keep track about the shipment of orders. Orderno identifies each order, shipdate will help determine when an order is shipped.

7 0
3 years ago
Which interest bearing account is best for people who won’t need access to their money for several months or longer?
lutik1710 [3]

The correct answer to this question is a certificate of deposit.

A certificate of deposit is an interest bearing account that pays a higher rate of interest than a savings account or interest bearing checking account because you are committing to leave it in the bank for a specified period of time. The CD could be for serveral months, or extend out to multiple years. Normally the interest rate will increase as the length of time increases.

3 0
3 years ago
What is the price of a k1 speed birthday party?
valentinak56 [21]
There is differen prices depending on the race go to the k1 website to see the packages
8 0
3 years ago
Read 2 more answers
IN MICROSOFT EXCEL YOU CAN UES FOMULA TO DIVIDE OR MULTIPLY WHAT IS THE CORRECT FORMULA TO CALCULATE 4*6
nexus9112 [7]

You actually have the correct answer. An excel formula starts with = so your answer would be =4*6

8 0
3 years ago
The number 68 is increased to 73. What is the percentage by which the number was increased, to the nearest tenth of a percent?
Ipatiy [6.2K]
Correct answer should be 1.1%
7 0
2 years ago
Read 2 more answers
Other questions:
  • Which of the following topics should you avoid bringing up during a college interview?
    10·2 answers
  • What are two examples of ways an electronic record may be distributed to others?
    15·1 answer
  • in a management information system, the quality of information is determined by its usefulness to users, and its usefulness dete
    8·1 answer
  • Which part of a computer takes the text and pictures on your screen and prints them onto paper?
    6·1 answer
  • 2 Manter o autocontrole nos ajuda a evitar muitos problemas na nossa vida pessoal e no ambiente profissional. Em se tratando de
    14·1 answer
  • While reviewing system logs, a security analyst notices that a large number of end users are changing their passwords four times
    13·1 answer
  • The simplest element that exists is only one proton and one electron. It is what stars are made of. It's symbol is "H". What is
    9·1 answer
  • HELP PLEASE
    7·1 answer
  • Write a for loop with a range function that prints the following output. Name the target variable number. 0 1 2 3 4 5
    6·1 answer
  • What is the advantage of entering metadata for electronic records that you create
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!