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 of the following is an example of joint problem solving?
tatuchka [14]

Explanation:

There is a high degree of informality to these relationships, which are focused on information sharing, joint-problem solving and joint operations.

A hallmark of most of these processes is their informality, whether through information sharing, joint problem solving or joint operations.

Global joint problem-solving team. In addition to requesting a division of labour, the Global Task Team recommendations called upon the World Health Organization (WHO), UNICEF, the United Nations Population Fund (UNFPA), the United Nations Development Programme (UNDP), the World Bank, the UNAIDS Secretariat and the Global Fund to take the lead in and establish the joint United Nations system-Global Fund problem-solving team by July # in order to support efforts that address implementation bottlenecks at the country level

4 0
2 years ago
Examples of sound effects that can be used in video games and a cartoon
astraxan [27]
BOOM!, KAPOWW!, X%[email protected]*?!, SLAP, BOING, DING, ZZZZ, etc.
8 0
3 years ago
How many people in the world
sveticcg [70]

Answer:

Around seven billion people

4 0
2 years ago
You can perform numbers___on binary
Masja [62]

Answer:

c) arithmetic operations

3 0
2 years ago
Read 2 more answers
What is the portion of the PowerPoint window that contains the current slide, total slides, zoom options, and various shortcuts
telo118 [61]
Normal view is the answer
7 0
3 years ago
Other questions:
  • Where does the oracle11g server store information about objects in the database, including information about constraints?
    15·1 answer
  • Which action is LEAST important to maintaining a healthy credit score?
    8·2 answers
  • Ethan wants to change the font in his document. He should _____.
    8·2 answers
  • If there is a mistake with one of your bank accounts, who should you contact to resolve the issue
    14·1 answer
  • Who were called “freedmen” during the reconstruction period?
    15·2 answers
  • 12. Kelly would like to know the average bonus multiplier for the employees. In cell C11, create a formula using the AVERAGE fun
    7·1 answer
  • In order for a fault-block mountain to form, a ______ must take place along a fault line and one side must be ________.
    11·1 answer
  • What is the difference between the Internet and the World Wide Web? Explain in your own words.
    13·2 answers
  • Your digital footprint says a lot about you, but not everything is true or accurate. When you're a high school or college studen
    13·1 answer
  • A(n) ________ address is the address that external entities use when communicating with your network.
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!