This C++ code defines a class called hussain with an output method, a struct called khan with string and float data types, and includes main functions like conditionals, loops, arrays to demonstrate different C++ concepts. It takes user input, performs operations based on the input, and outputs results.
1. // In 1 question whole c++
// Learn something this slide
// This slide is we helpfull
#include<iostream>
using namespace std;
class hussain{
public:
void output(){
cout<<"I am syed waqar hussiann";
}
};
struct khan{
string a;
float b;
};
void waqar(){
cout<<"ni am waqar hussainn";
}
main()
{
hussain def;
def.output();
waqar();
int a;
cout<<"Enter valuen";
2. cin>>a;
if (a==20){
cout<<"A=20n";
}
else
cout<<"Not = An";
khan abc;
cout<<"What is Structuren";
cin>>abc.a;
int b;
cout<<"Your Subjectn";
cout<<"1: BSSEn";
cout<<"2: BCSn";
cout<<"3: BNTn";
cout<<"Your choose heren";
cin>>b;
switch(b)
{
case 1 :
cout<<"Ur Subject is = BSSEn";
break;
3. case 2:
cout<<"Ur Subject is BCSn";
break;
case 3:
cout<<"Ur Subject is BNTn";
break;
default:
cout<<"khan";
}
for(int c=1;c<11;c++){
cout<<"nWaqar = "<<c;
}
int e[2]={1,2};
cout<<"n1st values = "<<e[0];
cout<<"n2nd value = "<<e[1];
string g[2];
cout<<"nEnter your name n";
cin>>g[0];
cout<<"Enter your father name n";
cin>>g[1];