Posts

Hackerrank C++ ---- Pointer

#include   < stdio.h > #include< stdlib.h > void   update ( int   * a , int   * b )   {      // Complete this function          int   tmp ;      tmp =* a +* b ;      * b = abs (* a -* b );      * a = tmp ; } int   main ()   {      int   a ,   b ;      int   * pa   =   & a ,   * pb   =   & b ;           scanf ( "%d %d" ,& a ,& b );      update ( pa , pb );      printf ( "%d\n%d" ,   a ,   b );      return   0 ; }

Hackerrank C++ --- Functions

#include <iostream> #include <cstdio> using namespace std; int main() {     int a, b, c, d;     cin>>a ; cin>> b ; cin>>c ;cin>> d ;     int   e , f ;   // variable = Expression1 ? Expression2 : Expression3   e = a>b ? a : b ;   f = c > d ? c:d ;   int  ans = e > f ? e : f ;   cout<<ans<< endl ;                return 0; }

Hacerrank C++ --- For Loop

#include   < iostream > #include   < cstdio > using   namespace   std ; int   main ()   {      // Complete the code.      int   a   ,   b    ,   g   ;      cin >>   a   ;      cin >>   b   ;        for   (   g   =   a   ;   g <= b   ;   g ++)   {          if ( g == 1 ){              cout   <<   "one"   <<   endl ;          }          else   if ( g == 2 )   {              cout   <<   "two"   <<   endl ; ...

Hackerrrank : Input and Output (C++)

Image
SOLUTION C++ :  #include   < cmath > #include   < cstdio > #include   < vector > #include   < iostream > #include   < algorithm > using   namespace   std ; int   main ()   {      /* Enter intyour code here. Read input from STDIN. Print output to STDOUT */          int   a , b , c , d   ;      cin >> a   ;   cin >> b   ;   cin >>   c   ;      d   =   a   + b   +   c   +   d   ;      cout << d   ;        return   0   ; } Objective In this challenge, we're practicing reading input from stdin and printing output to stdout. In C++, you can read a single whitespace-separated token of input using...

CodeChef ATM Problem Code: HS08TEST

Image
SOLUTION C++ : #include<iostream> #include<iomanip> using namespace std; int main() { int a; //a-amounttodebit float b ; float c; std::cin >> a; std::cin >> b; if(( (a+0.50) < b) && ((a) % 5==0) ) { c = b - (a+0.50) ; cout<<fixed<<setprecision(2)<<c<<endl; } else { //std::cout << b << std::endl; cout<<fixed<<setprecision(2)<<b<<endl; } } QUESTION Pooja would like to withdraw  X  $US from an ATM. The cash machine will only accept the transaction if  X  is a multiple of 5, and Pooja's account balance has enough cash to perform the withdrawal transaction (including bank charges). For each successful withdrawal the bank charges 0.50 $US. Calculate Pooja's account balance after an attempted transaction. Input Positive integer 0 <  X  <= 2000 - the amount of cash which Pooja wishes to withdraw. Nonnegative number...

Apple Enters INDIA in 2020 with E-Store

Image
Apple  to bring its presence to INDIA finally .   In the companies share Holder's meeting announced will open e-store in India sometime soon in 2020. Followed by , in 2021 the company will also set up its first flagship brick-and-mortar Store . currently Apple is selling its products in cut and Croma the other third-party stores . Tim Cook also said it is a country with the vibrancy and demographics in the share holder's meeting . he has also mention that he loves the customers from India and they are you eager to serve them online and in-store with the same experience and care that Apple customers Around The World enjoy . Apple has also planned to move 20% of the production from China to India , this decision may be decided on the basis of the virus. Apple manufactures are Foxconn and Wistron in India Apple is looking to scale its local revenue 40 billion dollars in India over the next five years and so they have planned to increase the production an...

How to easily create password protected folder

Image
TODAY YOU ARE GOING TO LEARN HOW  TO CREATE AN PASSWORD PROTECTED FOLDER STEP 1= OPEN NOTEPAD STEP 2=TYPE THE FOLLOWING CODE IN NOTEPAD cls @ECHO OFF title Folder Private if EXIST "HTG Locker" goto UNLOCK if NOT EXIST Private goto MDLOCKER :CONFIRM echo Are you sure you want to lock the folder(Y/N) set/p "cho=>" if %cho%==Y goto LOCK if %cho%==y goto LOCK if %cho%==n goto END if %cho%==N goto END echo Invalid choice. goto CONFIRM :LOCK ren Private "HTG Locker" attrib +h +s "HTG Locker" echo Folder locked goto End :UNLOCK echo Enter password to unlock folder set/p "pass=>" if NOT %pass%== PASSWORD_GOES_HERE goto FAIL attrib -h -s "HTG Locker" ren "HTG Locker" Private echo Folder Unlocked successfully goto End :FAIL echo Invalid password goto end :MDLOCKER md Private echo Private created successfully goto End :End STEP 3=YOU CAN PUT THE PASSWORD IN THE PLACE PASSWORD...