Showing posts from November, 2022Show all

1. Write a C++ program on simple try-catch mechanism.

open  Online C++ Compiler and enter below source code #include <iostream> using namespace std; int main ()  {    int a,b,x ;     cout << " enter values of a and b \n ";  cin >> a;  cin >> b;   x=a-b;     try     {        if( x != 0 )        {         cout <<" Result  a/x …

Read more