Question

valid C code for displaying all of the elements in the array letters from the previous Which of the following is question on one line, but in reverse order? a. int i; for (i 3; i>0; i-) printf( %c, letters(i-1]); } b. int i; for (i 2; i>o; i--) { printf( %c, letters[i+1)) ; } c. int i; for (i 0; i<3; i++) { printf( %c, letters[i]); } d. int i; for (i 1; i <-3; i++) { printf( %c, letters[i]); } e. int i for (i 3; i>1; i++) { printf( %c, letters[i]); } f. none of the above
0 0
Add a comment Improve this question Transcribed image text
Answer #1

0 s WC eusL J then Considar optim a s eind valu ol be be Lome edles vai et pointed仕haill orng to display becauue ters la+] teru l3). whe nothing s ai1) タ Sin ce index tat at so, and ncemunee il ia, at is gin4- Ophion ce)

Add a comment
Know the answer?
Add Answer to:
valid C code for displaying all of the elements in the array letters from the previous...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • What is wrong with the following code that prints out the elements of a 2x3 array?...

    What is wrong with the following code that prints out the elements of a 2x3 array? for (int i 0; i < 3; ++i) { for (int j = 0; j < 2: ++j) { printf("x(%d] [%d] ". %.2f\n", i, j, x[i][j]); O Expression ali]li] is incorrect O There is nothing wrong with the code 0 %2t is invalid O It is printing for a 3x2 array

  • Consider the following code: *How many elements in the array A are * also in the...

    Consider the following code: *How many elements in the array A are * also in the array B? Assume B is sorted. */ 01: int overlap (int* A, int* B, int N) 02:{ 03: int count = 0; 04: for (int i = 0; i < N; ++i) 05: 06: int x A [i 07: 08 int pos lower_bound (B, B+N, x) - B; if (pos N && B [pos] 09: 10: 11: 12: == x ) { +count; 13:...

  • Write a C Program that inputs an array of integers from the user along-with the length...

    Write a C Program that inputs an array of integers from the user along-with the length of array. The program then prints out the array of integers in reverse. (You do not need to change (re-assign) the elements in the array, only print the array in reverse.) The program uses a function call with array passed as call by reference. Part of the Program has been given here. You need to complete the Program by writing the function. #include<stdio.h> void...

  • Which of the following are valid array declarations? a. int[] array- new int[10]; b. double [array...

    Which of the following are valid array declarations? a. int[] array- new int[10]; b. double [array double[10]; c. charl charArray "Computer Science"; None of the above Analyze the following code: class Test public static void main(Stringl] args) System.out.println(xMethod(10); public static int xMethod(int n) System.out.println("int"); return n; public static long xMethod(long n) System.out.,println("long"); return n The program displays int followed by 10 The program displays long followed by 10. The program does not compile. None of the above. tions 3-4 are...

  • Consider the following C++code snippet and what is the output of this program? # include<iostream> using...

    Consider the following C++code snippet and what is the output of this program? # include<iostream> using namespace std; void arraySome (int[), int, int); int main () const int arraysize = 10; int a[arraysize]-1,2,3,4,5, 6,7,8,9,10 cout << "The values in the array are:" << endl; arraySome (a, 0, arraySize) cout<< endl; system ("pause") return 0; void arraySome (int b[], int current, int size) if (current< size) arraySome (b, current+1, size); cout << b[current] <<""; a) Print the array values b) Double...

  • C PROGRAM: answer both or don’t answer please! Problem 0.1 Write a C program that uses...

    C PROGRAM: answer both or don’t answer please! Problem 0.1 Write a C program that uses a loop to print all perfect cubes (1, 8, 27,...) up to 432 Question 0.2 What is the output of the following code ? int Array/41/8-111,-1,2), 3,4,-5), ,-1,0. 2,3,-7) int P3 int i.j for (i-Oi<3; it) Ph Arrayli for (i-0; i < 3; it+) Alilo)- *Pij+3) for (i-;i<4; ) printf("%d%e" ,A[i [0],',');

  • 10 What does the last printf in this code print to the screen? a)n-7 b)n- 0...

    10 What does the last printf in this code print to the screen? a)n-7 b)n- 0 c)n--1 d) None of the above 鬐include< stdio. h> int main) int n-0 for (n-7: n<O; n-- printf (n") printf ("n *%d", n); - return 11-What does the code print to the screen? 鬐include< stdio.h> void fun (int) int main) b) 8 d) None of the above fun (3) return void fun (int a) int x-10 while(a !_ 3 x > s} if a...

  • for c CHALLENGE ACTIVITY 9.7.1: Decrement array elements. Write a loop that subtracts 1 from each...

    for c CHALLENGE ACTIVITY 9.7.1: Decrement array elements. Write a loop that subtracts 1 from each element in lowerScores. If the element was already 0 or negative, assign 0 to the element. Ex lowerScores = {5,0,2,-3) becomes {4.0, 1.0). 1 include <stdio.h> 3 int main(void) 0 const int SCORES_SIZE - 4; int lowerScores [SCORES_SIZE]: int i; for (1 - 0; i < SCORES_SIZE; ++) { scanf("%d", &(lowerScores[i])); /" Your solution goes here / { 15 for (i = 0; i...

  • this is c code. please answer all questions on a piece of paper and show work....

    this is c code. please answer all questions on a piece of paper and show work. i need to prepare as i have a midterm i will have to be completing on paper 1) Bit Operators: This C program compiles and runs. What is its output? 1) #include <stdio.h> 2) void main (void) 3) unsigned char x =60; 4) 5) 6) 7) 8 ) 9) 10) 11) 12) 13) unsigned char a = x < 1; unsigned char b unsigned...

  • The following program sorts the array of numbers entered by the user and prints out the...

    The following program sorts the array of numbers entered by the user and prints out the elements in descending order. It has many errors. Debug the code and show the output. #include <stdio.h> #define N 4 void desc(float *a, float *b) float tp; tp=a; a=b; b=tp; int main() int i, j, ii, mark[N] ; for (ii==0;ii<N;ii++) printf("Enter the %d th element of your array: \n",ii); scanf("%d", mark[ii]); printf("You have entered the following array: \n"); for (ii=0,ii<N,ii++) printf("%d ", mark[ii]); printf("\n...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT