Posts

Showing posts from July, 2024

Diipole antenna calculator

Dipole Antenna Calculator Dipole Antenna Calculator Frequency: Unit: MHz GHz Dipole Length (mm): - Gap Length (mm): - Dipole Radius (mm): -

TRY AND CATCH FOR VOTING

 #include<iostream> using namespace std; int main() {     int age; cout<<"enter the age"<<"\n"; cin>>age; try {     if(age<=18)     throw "not eligible to vote";     cout<<"eligible to vote"; } catch(const char *ch) {     cout<<"age lesser"<<ch; } }

GLOBAL VARIABLES

 #include<iostream> using namespace std; int a,b; int multiply() {     a=198;     return 0; } int main() {     cout<<"BEFORE PROCESSING " ;     a=19;     cout<<a<<"\n";     multiply();     cout<<"AFTER PROCESSING "<<a;     return 0; }

SWITCH STATEMENTS

 #include<iostream> using namespace std; int main() {     int choice;     cout<<"enter the choice"<<"\n";     cin>>choice;     switch(choice)     {  case 1:     cout<<"1";     break;  case 2:     cout<<"2";     break;  default:      cout<<"unknown";     } }

PROGRAMS FOR TRY AND CATCH BLOCK

  TRY AND CATCH BLOCK WITH THE STRING July 09, 2024 TRY AND CATCH USING NUMBERS