Friday, December 6, 2024

USD TO INR C++ PROGRAMMING

 NALLAMUTHU GOUNDER MAHALINGAM COLLEGE                   

                           POLLACHI-642001

                                     R.Rasigapriya

                           Bsc Computer Science(Ist Year)

                              15.USD TO INR

#include <iostream>

int  main()

{

   double inr,usd;

   double rate;

   std::cout<<"Enter the USD"<<std::endl;

   std::cin>>usd;

   std::cout<<"Enter the indian rate for the USD"<<std::endl;

   std::cin>>rate;

   inr=usd/(1.0/rate);

   std::cout<<"The Indian rupee for the USD is\t"<<inr<<std::endl;

   return 0;

}

OUTPUT:



USD TO INR C++ program

  NALLAMUTHU GOUNDER MAHALINGAM       COLLEGE

                      POLLACHI-642001

                                                   N.DHIVYA

                                 BSC COMPUTER SCIENCE(1st year)

                                15.USD TO INR

#include <iostream>

int main()

{

    double inr,usd;

    double dollar;

    std::cout<<"Enter the US dollar:"<<std::endl;

    std::cin>>usd;

    std::cout<<"enter the value for one us dollar"<<std::endl;

    std::cin>>dollar;

    inr=usd/(1.0/dollar);

    std::cout<<"The indian ruppee for us dollars="<<inr;

    return 0;

}

OUTPUT:




FOR LOOP C++ PROGRAMMING

  NALLAMUTHU GOUNDER MAHALINGAM COLLEGE                   

                           POLLACHI-642001

                                     R.Rasigapriya

                           Bsc Computer Science(Ist Year)

                                         14.For loop

#include <iostream>

int main()

{

   for(int i=1;i<=40;i++)

   {

       std::cout<<"Number::"<<i<<std::end; 

   }

    return 0;

}

OUTPUT:





FOR LOOP C++ PROGRAM

 NALLAMUTHU GOUNDER MAHALINGAM       COLLEGE

                      POLLACHI-642001

                                                   N.DHIVYA

                                 BSC COMPUTER SCIENCE(1st year)

                       14.For Loop

#include <iostream>

int main()

{

    for(int i=1;i<=25;i++)

    {

    std::cout<<"value:"<<i<<std::endl;

    }

    return 0;

}

OUTPUT:






DO WHILE C++ PROGRAMMING

 NALLAMUTHU GOUNDER MAHALINGAM COLLEGE                   

                           POLLACHI-642001

                                     R.Rasigapriya

                           Bsc Computer Science(Ist Year)

                                   13.Do While

#include <iostream>

int main()

{

          int i=0;

    do

    {

                   std::cout<<i<<"\n";

                   i++;

          }

          while(i<=30);

          {

                   std::cout<<"STOP"<<std::endl;

          }

          do

          {

          std::cout<<i<<"\n";

                   i++;

          }

          while(i<=40);

          {

                   std::cout<<"READY"<<std::endl;

          }

          do

          {

                   std::cout<<i<<"\n";

                   i++;

          }

          while(i<=70);

          {

                   std::cout<<"GO"<<std::endl;

          }

          return 0;

}

OUTPUT:



 

 

 

 




DO WHILE C++ program

 NALLAMUTHU GOUNDER MAHALINGAM       COLLEGE

                      POLLACHI-642001

                                                   N.DHIVYA

                                 BSC COMPUTER SCIENCE(1st year)

                             13.Do While

#include <iostream>

int main()

{

   

    int i=0;

    do

    {

        std::cout<<i<<"\n";

        i++;

    }

    while(i<=30);

    {

        std::cout<<"stop"<<std::endl;

    }

    do

    {

        std::cout<<i<<"\n";

        i++;

    }

    while(i<=40);

    {

        std::cout<<"ready"<<std::endl;

    }

    do

    {

        std::cout<<i<<"\n";

        i++ ;

    }

    while(i<=70);

    {

        std::cout<<"go"<<std::endl;

    }

    return 0;

}

OUTPUT:







WHILE LOOP C++ PROGRAMMING

  NALLAMUTHU GOUNDER MAHALINGAM COLLEGE                   

                           POLLACHI-642001

                                     R.Rasigapriya

                           Bsc Computer Science(Ist Year)

                                 12.While loop



#include <iostream>

int main()

{

  int num;

  std::cout<<"Enter the Number:";

  std::cin>>num;

  while(num<=3)

  {

      std::cout<<"The statement is true";

  }

    return 0;

}

OUTPUT:

 



WHILE LOOP C++ program

 NALLAMUTHU GOUNDER MAHALINGAM       COLLEGE

                      POLLACHI-642001

                                                   N.DHIVYA

                                 BSC COMPUTER SCIENCE(1st year)

                               12.While Loop

#include <iostream>

int main()

{

    int num;

    std::cout<<"Enter the number:";

    std::cin>>num;

    while(num<=5)

    {

        std::cout<<"The statement is true";

    }

    return 0;

}

OUTPUT:




 


TO PRINT ZERO C++ program

 NALLAMUTHU GOUNDER MAHALINGAM       COLLEGE

                      POLLACHI-642001

                                                   N.DHIVYA

                                 BSC COMPUTER SCIENCE(1st year)

                              11.TO Print Zero

#include <iostream>

int main()

{

    int num1,num2;

    std::cout<<"Enter the two numbers:";

    std::cin>>num1>>num2;

    for(int i=0;i<=num1;i++){

    for(int j=0;j<=i;j++){

    std::cout<<num1%num2;

    }

    }

}

OUTPUT:




TO PRINT ZERO C++ PROGRAMMING

  NALLAMUTHU GOUNDER MAHALINGAM COLLEGE                   

                           POLLACHI-642001

                                     R.Rasigapriya

                           Bsc Computer Science(Ist Year)

                                   11.To Print Zero

#include <iostream>

int main()

{

   int num1,num2;

   std::cout<<"Enter the two numbers";

   std::cin>>num1>>num2;

   for(int i=0;i<=num1;i++){

   for(int j=0;j<=i;j++){

    std::cout<<num1%num2;

   }

   }

}

OUTPUT:



RECHARGE PLAN C++ PROGRAMMING

  NALLAMUTHU GOUNDER MAHALINGAM COLLEGE                   

                           POLLACHI-642001

                                     R.Rasigapriya

                           Bsc Computer Science(Ist Year)

                                    

                                       10.Recharge plan

#include <iostream>

int main()

{

    int number,pin;

    for(int i=1;i<=30;i++)

    {

      std::cout<<"Your phone validity is going to expire in "<<i<<" days"<<"\n";

        std::cout<<"You have to recharge now\n";

    }

    std::string networkplan;

    std::cout<<"Enter your networkplan\n";

    std::cin>>networkplan;

    std::cout<<"Enter your pin number\n";

    std::cin>>pin;

    if(pin==1234)

     {

    std::cout<<"your pin is correct\n";

   }

  else

    {

    std::cout<<"your pin is incorrect \n ";

    }

    if(networkplan=="Airtel1"&&pin==1234)

    {

        std::cout<<"*********************************\n";

        std::cout<<"Airtel\n";

        std::cout<<"Recharge plan\t"<<"Airtel"<<std::endl;

        std::cout<<"The data\t"<<"2 GB"<<std::endl;

        std::cout<<"Rupees\t\t"<<"361"<<std::endl;

        std::cout<<"Validity 28 days"<<std::endl;

        std::cout<<"Your mobile Number"<<std::endl;

        std::cin>>number;

        std::cout<<"Reacharged succesfully\n";

        std::cout<<"*********************************\n";

    }

    else if(networkplan=="Airtel2"&&pin==1234 )

    {

        std::cout<<"*********************************\n";

        std::cout<<"Airtel\n";

        std::cout<<"Recharge plan\t "<<"Airtel"<<std::endl;

        std::cout<<"The data\t"<<"15GB"<<std::endl;

        std::cout<<"Rupees\t"<<"181"<<std::endl;

         std::cout<<"Validity 28 days"<<std::endl;

        std::cout<<"Your mobile Number"<<std::endl;

        std::cin>>number;

        std::cout<<"Reacharged succesfully\n";

        std::cout<<"********************************\n";

    }

     else if(networkplan=="jio1"&&pin==1234 )

    {

        std::cout<<"*********************************\n";

        std::cout<<"Jio\n";

        std::cout<<"Recharge plan\t"<<"Jio"<<std::endl;

        std::cout<<"The data\t"<<"3 GB"<<std::endl;       

        std::cout<<"Rupees\t\t"<<"348"<<std::endl;

         std::cout<<"Validity 28 days"<<std::endl;

        std::cout<<"Your mobile Number"<<std::endl;

        std::cin>>number;

        std::cout<<"Reacharged succesfully\n";

        std::cout<<"********************************\n";

   }

     else if(networkplan=="jio2"&&pin==1234)

    {

        std::cout<<"*********************************\n";

        std::cout<<"jio\n";

        std::cout<<"Recharge plan\t"<<"Jio"<<std::endl;

        std::cout<<"The data\t"<<"1.5"<<std::endl;

        std::cout<<"Rupees\t"<<"299"<<std::endl;

         std::cout<<"Validity 28 days"<<std::endl;

        std::cout<<"Your mobile Number"<<std::endl;

        std::cin>>number;

        std::cout<<"Reacharged succesfully\n";

        std::cout<<"********************************\n";

    }

     else if(networkplan=="vodafone1"&&pin==1234)

    {

        std::cout<<"*********************************\n";

        std::cout<<" vodafone1\n";

        std::cout<<"Recharge plan\t"<<"vodafone"<<std::endl;

        std::cout<<"The data\t"<<"2GB"<<std::endl;

        std::cout<<"Rupees\t\t"<<"849"<<std::endl;

         std::cout<<"Validity 28 days"<<std::endl;

        std::cout<<"Your mobile Number"<<std::endl;

        std::cin>>number;

        std::cout<<"Reacharged succesfully\n";

        std::cout<<"********************************\n";

    }

     else  if(networkplan=="vodafone2"&&pin==1234)

    {

        std::cout<<"*********************************\n";

        std::cout<<" vodafone2\n";

        std::cout<<"Recharge plan\t"<<"vodafone"<<std::endl;

        std::cout<<"The data\t"<<"2 GB"<<std::endl;

        std::cout<<"Rupees\t\t"<<"349"<<std::endl;

         std::cout<<"Validity 28 days"<<std::endl;

        std::cout<<"Your mobile Number"<<std::endl;

        std::cin>>number;

        std::cout<<"Reacharged succesfully\n";

        std::cout<<"********************************\n";

    }

      else if(networkplan=="bsnl1"&&pin==1234)

   {

        std::cout<<"*********************************\n";

        std::cout<<"BSNL1\n";

        std::cout<<"Recharge plan\t"<<"BSNL"<<std::endl;

        std::cout<<"The data\t"<<"1 GB"<<std::endl;

        std::cout<<"Rupees\t\t"<<"108"<<std::endl;

         std::cout<<"Validity 28 days"<<std::endl;

        std::cout<<"Your mobile Number"<<std::endl;

        std::cin>>number;

        std::cout<<"Reacharged succesfully\n";

        std::cout<<"********************************\n";

    }

    else if(networkplan=="bsnl2"&&pin==1234)

    {

        std::cout<<"********************************\n";

        std::cout<<"BSNL2\n";

        std::cout<<"Recharge plan\t"<<"BSNL"<<std::endl;

        std::cout<<"The data\t"<<"4"<<std::endl;

        std::cout<<"Rupees\t\t"<<"197"<<std::endl;

         std::cout<<"Validity 28 days"<<std::endl;

        std::cout<<"Your mobile Number"<<std::endl;

        std::cin>>number;

        std::cout<<"Reacharged succesfully\n";

        std::cout<<"********************************\n";

    }

    else

    {

        std::cout<<"You have other available plan"<<std::endl;

    }

 

    return 0;

}


OUTPUT:







USD TO INR C++ PROGRAMMING

  NALLAMUTHU GOUNDER MAHALINGAM COLLEGE                                                 POLLACHI-642001                                     ...