192,471 views
6 votes
6 votes
HTTP is the protocol that governs communications between web servers and web clients (i.e. browsers). Part of the protocol includes a status code returned by the server to tell the browser the status of its most recent page request. Some of the codes and their meanings are listed below: C++

200, OK (fulfilled)

403, forbidden

404, not found

500, server error

Given an int variable status, write a switch statement that prints out the appropriate label from the above list based on status.

I'm getting an error on this.

This is my code:


cout << "Enter a status";

cin >> status;

switch (status)

{

case 200:

break;

case 403:

break;

case 404:

break;

case 500:

break;

}

User Cong Nguyen
by
2.6k points

1 Answer

24 votes
24 votes

Answer:

the answer is your mind think and you will get it like me it's ()

User Kiran Ruth R
by
2.9k points