Question

Please answer the questions below about the following code segment in C: int x, y, z int *ix, *iy, *iz; char *c Hello; x10; ?- 20; z=30; iz = &z; x = z + *IZ; 200 t 30?130 2200; 1. What is the value of ix? 2, What is the value of *iy? 3. What is the value of *iz? 4. What is the value of c[0]? 5. What is the value of c[strlen(c) - 1]?

0 0
Add a comment Improve this question Transcribed image text
Answer #1

*ix =60

//*ix stores the value of x. Given x=z+*iz I.e, 30+30. *iz will be 30 beacuse z value is change after this statement.

*iy=50

Given y=y+z I.e, 20+30

*iz=200

// z value changed to 200 so *iz will also be 200

c[0] =H

//0th index of c is H

c[strlen(c)-1]=o

//Gets last character of the string

Add a comment
Know the answer?
Add Answer to:
Please answer the questions below about the following code segment in C: int x, y, z...
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
  • Given the following code segment, int x = 20; int y = 7; what is the...

    Given the following code segment, int x = 20; int y = 7; what is the data type of the value of the expression (x % y) ? (3 points) Question 1 options: 1) int 2) double 3) numeric 4) Error: possible loss of precision 5) Unable to be determined Question 2 (3 points) Given the following code segment, double x = 42.3; double y = 11.7; what is the data type of the value of the expression (x %...

  • 20) What is the output of the following segment of C code: int avg(int n, int*...

    20) What is the output of the following segment of C code: int avg(int n, int* a); int main () {             int array[4]={1,0,6,9};             printf("%d", avg(4, array)+ 1);             system("pause");             return 0; } int avg(int n, int* a) { int i, sum=0; for (i=0;i<n;i++) { sum+=a[i]; } return sum/n; } a) 16 b) 5 c) 4 d) 8 21) What is the output of the following segment of C code: int x = 2; int y = 3;...

  • Code that needs to be modified: #include <stdio.h> #include <math.h> int main(void) { FILE * fileout; int ix,iy,it,Nt; double newV[31][21],V[31][21],x,dx,y,dy; fileout=fopen("buckbeak....

    Code that needs to be modified: #include <stdio.h> #include <math.h> int main(void) { FILE * fileout; int ix,iy,it,Nt; double newV[31][21],V[31][21],x,dx,y,dy; fileout=fopen("buckbeak.dat","w"); printf("\nEnter number of iterations "); scanf("%d",&Nt); dx=0.10; dy=0.10;    for(iy=0; iy<21; iy=iy+1) { for(ix=0; ix<31; ix=ix+1) { V[ix][iy]=0.0; } } iy=20; for (ix=0;ix<31; ix=ix+1)    {    V[ix][iy]=8.0;    } for (it=0; it<Nt;it=it+1) { for(iy=1; iy<20;iy=iy+1) { for(ix=1;ix<30; ix=ix+1) { newV[ix][iy]=0.25*(V[ix+1][iy]+V[ix-1][iy]+V[ix][iy+1]+V[ix][iy-1]); } } for (iy=1; iy<20; iy=iy+1) { for(ix=1; ix<30; ix=ix+1) { V[ix][iy]=newV[ix][iy]; } }    } for (iy=0;iy<21;iy=iy+1) { y=dy*iy; for (ix=0;ix<31;ix=ix+1) {...

  • 5. (Extra problem.) Find the standard matrix for T : C → C2 defined by T(z, y, z)"-(x + iy, x-iz)" .

    5. (Extra problem.) Find the standard matrix for T : C → C2 defined by T(z, y, z)"-(x + iy, x-iz)" . 5. (Extra problem.) Find the standard matrix for T : C → C2 defined by T(z, y, z)"-(x + iy, x-iz)" .

  • C++ ONLY! Consider the following code and answer the questions in the table below. #include <iostream>...

    C++ ONLY! Consider the following code and answer the questions in the table below. #include <iostream> template <typename T, int N=10> class Array { private:   T array[N+1]; public:   Array() {     for(int i=0; i<N+1; i++) array[i] = 0;   }      T& operator [] (int index) {     if (index>N || index < 0)       return array[N];     else       return array[index];   }   template <typename S>   Array<T,N>& operator= (S &other) {     for(int i=0; i<N+1; i++)       array[i] = other[i];         return *this;   } }; template <typename T, typename...

  • QUESTION 62 Consider the following code: void Pancake(int x, int& y, int z); void Waffle(int& x,...

    QUESTION 62 Consider the following code: void Pancake(int x, int& y, int z); void Waffle(int& x, int& y); int Doughnut(int y, int z); int main( ) {             int a = 1;             int b = 2;             int c = 3;             int d = 4;             Pancake(a, b, c);             Waffle(b, c);             Pancake(d, c, b);             d = Doughnut(b, a);             return 0; } void Pancake(int x, int& y, int z) {             y += 3;            ...

  • should be in C language What is the output of the following segment of C code:...

    should be in C language What is the output of the following segment of C code: void CapsLetter (char* x, charl); int main() { char* text; text="This is some sample text."; CapsLetter(text, 'e'); printf("%s", text); return 0; سی void Caps Letter (char* x, char 1) { int i=0; while (x[i]!='\0') { if (x[i]==1) x[i]=1-32; } 1. This is som sample text. 2. THIS IS SOME SAMPLE TEXT. 3. This is some sample text. 4. this is some sample text. What...

  • Find the Moment of inertia of: a) The rectangular solid formed by 0≤x≤a,0≤y≤b, and 0≤z≤c by...

    Find the Moment of inertia of: a) The rectangular solid formed by 0≤x≤a,0≤y≤b, and 0≤z≤c by calculating Ix, Iy, Iz. [Hint: Compute one of the moments directly and then reason about the other cases via symmetry]. b) The x, y and z axes of a thin plate bounded by the parabola x=−y2 and the line x=−y with the density function defined as δ(x,y) = 1/y. Find the Moment of inertia of: (a) (15 points) The rectangular solid formed by 0...

  • 31. The following code segment is syntactically correct:              int number{20};          cout << number <<...

    31. The following code segment is syntactically correct:              int number{20};          cout << number << setbase(16) << " " << number                               << setbase(10) << " " << number                                 << showpos << " " << number << endl;                 T__   F__       32. The following statement wants to determine if ‘count’ is outside the     range of 0 through 100:             if (count < 0 && count > 100)                                             T__   F__ 33. There is...

  • Write the output of the following segment of code and explain your results. int x=7, y=4,...

    Write the output of the following segment of code and explain your results. int x=7, y=4, z; float z1, z2, z3; z1=x/y; z2=(float)(x/y); z3=(float)x/y; z=x/y; System.out.printf("z=%d z1=%5.2f z2=%5.2f z3=%5.2f \n}, z, z1, z2, z3);

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
Active Questions
ADVERTISEMENT