COMPUTER SCIENCE POINTER

2.c) Give the output of the following program:

#include<iostream.h> #include<string.h>
class per
{ char name[20];
float salary;
public:
per(char *s, float a)
{ strcpy(name,s);
salary=a;
}
per *GR(per &x)
{ if(x.salary>=salary)
return &x;
else
return this;
}
void display( )
{ cout<<”Name:“<<name<<”\n”;
cout<<”Salary:“<<salary<<”\n”;
}
};
void main( )
{ Per P1(“REEMA”,10000),
P2(“KRISHNAN”,20000),
P3(“GEORGE”,5000);
per *P;
P=P1.GR(P3);P->display( );
P=P2.GR(P3);P->display( ); }

4

1999:

1.d) Give the output of the following program.

#include<stdio.h>
void main( )
{ char *p=”Difficult”;
char c; c=*p++; printf(“%c”,c);
}

 

CBSE Computer Science Solved Revision Tour By Mr. Ravi Kiran ( mrkdata@yahoo.com )


Warning: include_once(../../ebooks-footer19.php): Failed to open stream: No such file or directory in /home/cbseguess/public_html/ebooks/xii/coumputer-science/pointer5.php on line 113

Warning: include_once(): Failed opening '../../ebooks-footer19.php' for inclusion (include_path='.:/opt/cpanel/ea-php83/root/usr/share/pear') in /home/cbseguess/public_html/ebooks/xii/coumputer-science/pointer5.php on line 113

Warning: include_once(../../../footer19.php): Failed to open stream: No such file or directory in /home/cbseguess/public_html/ebooks/xii/coumputer-science/pointer5.php on line 115

Warning: include_once(): Failed opening '../../../footer19.php' for inclusion (include_path='.:/opt/cpanel/ea-php83/root/usr/share/pear') in /home/cbseguess/public_html/ebooks/xii/coumputer-science/pointer5.php on line 115