C++ Switch Statement

This C++ Program which illustrates the use of switch statement. The program takes percentage as the input and the grade is output on the screen using the switch statement. Here is source code of the C++ program which illustrates the use of switch statement. The C++ program is successfully compiled and run on a Linux … Read more


Try Catch Program in C++

This C++ program illustrate try-catch statement. The keyword try initiates a try-block in which statements can be executed. Then, the catch statement acts as a specifier of the type of exception to be caught if thrown from within the try-block. The compound-statement which follow the catch-statement is called the exception-handler and contains statements to be … Read more


C++ Goto Statement

This C++ program illustrates goto statement. The goto statement transfers control to the location specified by label. The goto statement must be in the same function as the label it is referring, it may appear before or after the label. The program prints numbers 1 to 10 without using any loop. Here is the source … Read more


Do While Loop Program in C++

This C++ program demonstrates the use of do-while loop. The do-while loop works the same way as a while or for loop with a difference that the condition for execution of the next iteration is checked after the execution of statements inside the block. Here is the source code of the C++ program demonstrates the … Read more

Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.