Respuesta :
Answer:
Following are the loop in c language
t = sizeof(courseGrades)/sizeof(courseGrades[0]); // determine the size of array
for(int i=0;i<t;++i) // iterating loop
{
printf("%d ",courseGrades[i]); // print the array in forward direction with space
}
for(int i=t-1;i>=0;--i)// iterating loop
{
printf("%d ",courseGrades[i]); // print the array in backward direction with space
}
Explanation:
In this firstly we find a size of the courseGrades array in variable "t" after that we created a loop for print the courseGrades array in forward direction with space.
finally we created a loop for printing the courseGrades array in backwards direction.
Following are the program in c language :
#include <stdio.h> // header file
int main() // main function
{
int courseGrades[]={7, 9, 11, 10}; // array declaration
int t; // variable t to store the length of the array
t = sizeof(courseGrades)/sizeof(courseGrades[0]); // determine the size of array
for(int i=0;i<t;++i) // iterating loop
{
printf("%d ",courseGrades[i]); //print the array in forward direction with space
}
for(int i=t-1;i>=0;--i) // iterating loop
{
printf("%d ",courseGrades[i]);// // print the array in backward direction with space
}
return 0;
}
Output:
7 9 11 10 10 11 9 7