Posts

Showing posts from November, 2021

//Write a program to find a frind's father's name by taking the name of your friends:

 /****************************************************************************** Welcome to GDB Online. GDB online is an online compiler and debugger tool for C, C++, Python, PHP, Ruby,  C#, VB, Perl, Swift, Prolog, Javascript, Pascal, HTML, CSS, JS Code, Compile, Run and Debug online from anywhere in world. *******************************************************************************/ #include <iostream> using namespace std; int main() {         //Write a program to find a frind's father's name by taking the name of your friends:     string name;      cout<<"Enter your name :";      getline(cin,name);           if (name == "Minhaj"){          cout<<"You father's name is Aurangzeb Ansari";      } else if(name=="sajid"){          cout<<"You father's name is Tabarkh Uncle";      }e...

if else practice question for beginners with solution

  #include <iostream> using namespace std ; int main (){     //date-12/11/2021 /*int length, breadth; cout<<"Enter the length and breadth of the rectangle. :"; cin>>length; cin>>breadth; if(length==breadth){   cout<<"yes it is square" ; } else { cout<<"It is not Square"; } // Take three int input from user from user and print greatest among them . int num1,num2,num3; cout<<"Enter the first number :" <<endl; cin>>num1; cout<<"Enter the first number :"<<endl; cin>>num2; cout<<"Enter the first number :"<<endl; cin>>num3; if (num1>num2 && num3<num1){   cout<<"First number is greater : "<<num1;    }    else if (num2>num1 && num3<num2){    cout<<"Second number is greater : "<<num2; } else {    cout<<"Third number is greater : "<<num3; }  int bholu,...