C++ doubts:4 2mrw's xam.. help!

1. char ch;
cin.get(ch).get(ch);//How this statement is valid??-2 get() func.

2."this" pointer, random()function // Is it there in the CBSE syllabus

3.pls. illustrate (pls give eg.)scanf and printf statements(especially
for outputs)

4.Give output-
void main()
{
int x[]={10,20,30,40,50};
int *p, **q, *t;
p=x;
t=x+1;
q=&t;
cout<<*p<<","<<**q<<","<<*t++;
}

5. How to detect end of file without using eof() function.

6.Give the ouput and explain
#include<iostream.h>
void main()
{
int a =32, *ptr=&a;
char ch='A' , &cho=ch;
cho+=a; *ptr+=ch;
cout<<a<<" "<<ch<<endl;
}
7.Convert the infix expression:
A-B+C*D^E*G/H into postfix expression. Evaluate the postfix expresstion showinf the status of stack at every step given
A=5, B=2,C=4,D=2,E=1,G=6,H=5;
//Atleast explain the use of exponential operator here..

8.Why Insertion sort is more efficient than other sorts?

42 Answers

33
Abhishek Priyam ·

this question too..

a[ 5]={7,19,8,12,13};
int *p;
p=a;
cout<<*++p<<++*p<<*p++;

actually i want to ask:

*p++ = (*p)++ or *(p++)

62
Lokesh Verma ·

sriyou are right.. i missed that one in hadbadi

It willbe 30 because the pointer value will increase by 1 :)

1
sriraghav ·

URGENT PLEASE!!!

1
sriraghav ·

@ankit , wat is '%' in scanf and printf.. statemetns??

33
Abhishek Priyam ·

5.

fstream f1;

f1 becomes 0 when eof is detected...

1
sriraghav ·

@sir, but wat abt value of q.. ie how it bcame 30(instead of 20)

1
sriraghav ·

@priyam, does f1 implicitly invoke eof()... or just like that..??

1
Vivek ·

In insertion sort the no of comparisions done is much lesser than selection sort

bubble sort takes max time because of max comparisions

1
sriraghav ·

In finding SOP using K-maps...I paired two ones as shown in the LHS pic, but in marking scheme the pattern was as on RHS pic(OTHER pairing and grouping 4 ones are same except this ), so there exists 2 diff ans.. which is correct??

1
Vivek ·

no f1=0,when the ptr becomes NULL

1
sriraghav ·

@vivek and nishant sir.. Thanx 4 ins sort answer...

1
sriraghav ·

thanx priyam and vivek 4 eof answer :)

Your Answer

Close [X]