You are on page 1of 1

c++ :

week 1:

Q1:
stack <char> s; //LINE-1

for(int i = 0; i < strlen(str); i+=2)


s.push(str[i]); //LINE-2

int len = s.size();

for(int i = 0; i < len; i++) {

ch=s.top(); //LINE-3

Q2:

sqrt((p2.x - p1.x)*(p2.x-p1.x)+(p2.y-p1.y)*(p2.y-p1.y));

Q3:

bool max_str( string a, string b) { //LINE-1

return a > b; //LINE-2


}

You might also like