Assignments - XII Computer Science
POINTERS ASSIGNMENT Assignment Date: 09/09/15 Submission Date: 14/09/15 Q1. What will be the output of the following program: int main() { int x [ ] = { 50, 40, 30, 20, 10}: int *p, *t; p = x; t = x + 1; cout << *p << “,” << *t++; return 0; } Q2. What will be the output of the program( Assume all necessary header files are included) void print (char * p ) { p = "Comp"; cout<<"value is "<<p<<endl; } int main( ) { char * x = "Class XII"; print(x); cout<<"new value is "<<x<<endl; return 0; } Q3. Identify errors on the following code segment, and underline the error. float c[ ] ={ 1.2,2.2,3.2,56.2}; float *k,*g; k=c; g=k+4; k=k*2; g=g/2; cout<<”*k=”<<*k<<”*g=”<<*g; Q4. Write the output of the following program. void print (char * p ) { p = "Comp"; cout<<"valu...