Login


Lost your password?

Don't have an account ?
Register (It's FREE) ×
  


Shop
CPP All : Pointer and Arrays


Exam Papers Problems

Output writing – Pointer to array #5204

( As In Exam - CBSE12A-2018 )

Find and write the output of the following C++ program code:
Note : Ass

Find and write the output of the following C++ program code:
Note : Assume all required header files are already included in the program.

 

#define Modify(N) N*3+10
void main()
{
  int LIST[]={10,15,12,17};
  int *P=LIST, C;
  for(C=3; C>=0; C--)
    LIST[I]=Modify(LIST[I]);
  for (C=0; C<=3; C++)
  {
    cout<<*P<<":";
    P++;
  }
}

 

Output writing with pointer based traversing of an array #5318

( As In Exam - CBSE12A-2017 )

Find and write the output of the following C++ program code: Note: Assume al

Find and write the output of the following C++ program code: Note: Assume all required header files are already being included in the program.

void main()
{
  int *Point, Score[]={100,95,150,75,65,120};
  Point = Score;
  for(int L = 0; L<6; L++)
 {
    if((*Point)%10==0)
      *Point /= 2;
    else
      *Point -= 2;
    if((*Point)%5==0)
      *Point /= 5;
    Point++;
  }
  for(int L = 5; L>=0; L--)
    cout<<Score[L]<<"*";
}
Solved Problems

Output Writing Based on char and int array reference #5051

Write output of the following code. Assume that all relevant header files hav

Write output of the following code. Assume that all relevant header files have been added.

int main()
{
  char *text = "AJANTA";
  int *p, num[]={1,5,7,9};
  p=num;
  cout<<*p<<text<<endl;
  text++;
  p++;
  cout<<*p<<text<<endl;
}

Output Writing – Modifying and Reading int array using a pointer variable #5054

Write output of the following code.

int main()
{
  int *striker, t

Write output of the following code.

int main()
{
  int *striker, track[] = {10,20,30,40};
  striker=track;
  track[1]+=30;
  cout<<"striker"<<*striker<<endl;
  *striker-=10;
  striker++;
  cout<<"Next@"<<*striker<<endl;
  striker+=2;
  cout<<"Last@"<<*striker<<endl;
  cout<<"Rest to"<<track[0]<<endl;
  return 0;
}

Output writing – Pointer to string and integer array #5376

Find and write the output of the following C++ program code: Note: Assume al

Find and write the output of the following C++ program code: Note: Assume all required header files are already being included in the program.

void main()
{
  char *str = "SARGAM";
  int *ptr, A[]={1,5,7,9};
  ptr = A;
  cout<<*ptr<<str<<endl;
  str++;
  ptr+=3;
  cout<<*ptr<<str<<endl;
}

Exam Paper Problems:2  Solved Problems:3 
×
Introductory Sessions Beginning to Program Tokens Keyword and Identifiers Data Types Variables and Constants Operators Simple User Input Building Expressions and Formulas Simple Real World Problems Simple If and If Else Multiple-Nested-Ladder of If Else Switch case selection Simple Loops Tricks in Loops - break continue scope Loop Applications - Handling numerals Series printing loops Nested Loops Pattern printing loops Number Varieties and Crunches String Handling (Null Terminated) Strings - string class type Functions (Built-in) Functions - user defined Functions Reference Passing/Returning Arrays Concepts and 1-D Arrays Array Data Management Two dimensional arrays and Matrices Structures Basics Structures passing/returning Display Using IO Manipulation Display Using C Formatting Tricks User Defined Data Types Enumerated Types Preprocessor Directives And Macros Exception Handling Programming Paradigms and OOPs Advantages Abstraction and Encapsulation Polymorphism Inheritance Function Overloading Concepts Function Overloading Varieties Function Overloading Special Cases Defining Classes Creating and Using Class Objects Class Members Accessibility Class Function Types Inline Functions Constant Functions Nesting of Functions Class Members Scope Resolution Static Members in a Class Array of Objects Constructor Concepts Default Constructor Parameterized Constructor Copy Constructor Constructor Overloading Destructors Inheritance Fundamentals Public Derivations Private and Protected Derivations Multiple Inheritance Mult-Level Inheritance Class Nesting Data File Concepts Handling Text Files Handling Binary Files Pointer Concepts Pointer and Arrays Pointers and Functions Object Pointers This Pointer Linked Lists Stacks Queues


Back