Saturday, November 24, 2018

33. WAP to implement a calculator using Switch Case.

#include<stdio.h>
#include<conio.h>
#include<math.h>
void main()
{
   float x,y,result;
   char ch;
   printf("=========== MENU ===========");
   printf("\n  ADDITION        -> +"
          "\n  SUBTRACTION     -> -"
          "\n  MULTIPLICATION  -> *"
          "\n  DIVISION        -> /"
          "\n  SQUARE          -> S"
          "\n  CUBE            -> C"
          "\n  SQUARE ROOT     -> s"
          "\n  CUBE ROOT       -> c"
          "\n  MODULUS         -> m"
          "\n  RECIPROCAL      -> r");
   printf("\n\nEnter your choice: ");
   scanf("%c",&ch);
   result=0;
   switch(ch)
   {
       case '+':
    printf("\nEnter two numbers: ");
    scanf("%f%f",&x,&y);
    result=x+y;
                   printf("Result = %0.2f",result);
                  break;
       case '-':
    printf("\nEnter two numbers: ");
    scanf("%f%f",&x,&y);
    result=x-y;
          printf("Result = %0.2f",result);
                  break;
       case '*':
    printf("\nEnter two numbers: ");
    scanf("%f%f",&x,&y);
    result=x*y;
                   printf("Result = %0.2f",result);
                  break;
       case '/':
printf("\nEnter two numbers: ");



    scanf("%f%f",&x,&y);
        if(y==0 || (x==0 && y==0))
                   {
printf("\nCannot divide by zero.");
                      break;
                   }
                   result=x/y;
                   printf("Result = %0.2f",result);
                   break;
       case 'S':
    printf("\nEnter the number: ");
    scanf("%f",&x);
    result=pow(x,2);
                   printf("Result = %0.2f",result);
                  break;
       case 'C':
    printf("\nEnter the number: ");
    scanf("%f",&x);
    result=pow(x,3);
                   printf("Result = %0.2f",result);
                  break;
       case 's':
    printf("\nEnter the number: ");
    scanf("%f",&x);
    result=pow(x,0.5);
                   printf("Result = %0.2f",result);
                  break;
       case 'c':
    printf("\nEnter the number: ");
    scanf("%f",&x);
    result=pow(x,0.33333);
                   printf("Result = %0.2f",result);
                  break;
       case 'm':
printf("\nEnter two numbers: ");
    scanf("%f%f",&x,&y);
        if(y==0)
                   {
printf("\nResult is undefined.");
                      break;
                   }
                   result=(int)x%(int)y;
                   printf("Result = %0.2f",result);
                   break;
       case 'r':
printf("\nEnter the number: ");
    scanf("%f",&x);
    if(x==0)
{
    printf("\nCannot divide by zero.");
                      break;

                   }
                   result=1/x;
                   printf("Result = %0.2f",result);
                   break;
       default:
printf("Invalid choice!!");
                 break;
   }
   getch();
}


Output:




Please have a look at the below lesson posted on my YouTube channel:

Wednesday, November 21, 2018

6. Ajeeb Dastan Hai Yeh

Intro (Improvised):
---------------------
Fr -> 11 11 9 11 8 11 12 8 11 11 -|
St ->  3  2 2  3 3  4  4 3  3  2 -|

Fr -> 11 11 9 11 8 11 12 8 11 9 -|
St ->  3  2 2  3 3  4  4 3  3 2 -|

Fr -> 9 11 9 11 8 11 12 8 8 9 -|
St -> 2  2 2  3 3  4  4 3 3 2 -|

Fr -> 11 9 11 8 11 12 8 9 9 11 -|
St ->  2 2  3 3  4  4 3 2 2  3 -|
------------------------------------------------------------------

Song:
------
         Ajeeb dastaan hain ye                          \
                                                  s                 \
         ---------                            ----                \
Fr -> 12 12 12 10 12 10 12 10 8 8 12 -|             |
St ->   3  2   1   1   1   1  2   2 2 2   2 -|             |
                                                                       |
         Kahan shuru kahan khatam                      |
                                                  s                   |
         ---------                            ----                 |
Fr -> 12 12 12 10 12 10 12 10 8 8 10 -|             |
St ->   3  2   1   1   1   1  2   2 2 2   2 -|             |  (x 2 times)
                                                                       |
         Ye manzile hain kaunsi                             |
                                                  s                   |
         ---------                            ----                 |
Fr -> 12 12 12 10 12 10 12 11 9 11 9 -|             |
St ->  4   3   2   2   2   2  3   3 3   3 3 -|             |
                                                                       |
         Na woh samajh sake na hum                     |
                                        s                              |
                                       ---                            /
Fr -> 10 10 12 10 12 10 8 8 3 -|                      /
St ->   1  1   1   1   2   2 2 2 2 -|                    /

         Ye roshni ke saath kyun                       \
                                   s                               \
                        p      ------                             \
Fr -> 8 10 7 8 7 8 10 10 13 -|                         |
St -> 2   2 1 1 1 1  2   2   2 -|                         |  (x 2 times)
                                                                     |
         Dhuaan utha chiraag se                        /
Fr -> 10 10 12 10 13 12 12 10 -|                  /
St ->   1   1  1   1   2   2   1  1 -|                 /

         Ye khwaab dekhti hoon mein
                              s
                         p  ----
Fr -> 14 14 12 14 12 14 10 8 -|
St ->   1   1  1   1   1   1   1 1 -|

         Ke jag padi hoon khwaab se
                                s
                               ---
Fr -> 10 10 12 10 12 10 8 8 3 -|
St ->   1   1  1   1   2   2 2 2 2 -|
------------------------------------------------------------------

Fillers:
-------
Fr -> 3 2 0 2 2 0 2 2
St -> 5 4 3 3 3 3 4 3

Fr -> 5 5 5 3 5 5 5 3
St -> 1 1 1 1 2 2 1 1

Fr -> 5 7 5 7 7 5 7
St -> 6 6 5 5 5 4 4


  /   |\  | |```      ````` |   | |```  |\  |     |```   |```  |```  |```     /   `````
 / \  | \ | |     |        |     |---| |``    | \ |     |___| |``    |___| |``     /   \    |  
/   \ |  \| |___|       |      |   | |____ |  \|     |   \   |____ |       |____ /     \   |  

````` |   | |```      |''''''     /    |\    /| |```      `````   /    |```   |''''''
    |    |---| |``        ````  /  \  | \  / | |``           |      /  \  |````  ````
    |     |   | |____     ___| /    \ |  \/  | |____       |     /    \ |____| ___| _
                                                                                                        /

|````` |\   | |        \   /     |         \   / |`````  ```````  |````    |````
|      | |  \ | |          \/      |          \/   |___|      |      |          ````
|___| |   \| |____  /       |____  /    |    \   _____  |____ ___|
|`````     |   |     /     |\   | |````    |```     |````
|           |---|   /   \  |  \ | |     ``| |``       ````
|_____ |    | /      \ |   \| |____| |____ ___|



The song has been demonstrated in the below video. If you find any difficulty playing the above tabs then please have a look at this video ↓↓↓


Sunday, November 18, 2018

5. Cadbury Ad - Kiss Me

                Kiss Me
                  s  s    
                 -----   
Fr -> 3 0 2 3 2 3 -|
St -> 5 4 4 4 4 4 -|

        Close your eyes
             s sp
           ------ 
Fr -> 0 2 3 2|
St -> 3 3 3 3|

(Note: sp -> slide and pluck. Please watch the below video to view the demo.)

        Miss me
          s s
        ------
Fr -> 3 2 3 -|
St -> 4 4 4 -|

        Close your eyes
             s s
           ------
Fr -> 0 2 3 2|
St -> 3 3 3 3|

         I can read..  On your..
Fr -> 3 0 2 0 2 3 -|3 0 3 0 2 -|
St -> 4 3 3 3 3 4 -|4 3 4 3 4 -|

         I can feel..   Come on your..
                  s                s
                 ---             ---
Fr -> 3 0 2 2 5 3 -|3 0 2 3 2 -|
St -> 4 3 3 3 3 4 -|4 3 3 3 4 -|

        And happiness..
                     s  s
                    -----  p
Fr -> 5 5 3 3 2 3 2 0|
St -> 5 5 3 3 3 3 3 3|


HIGHER OCTAVE:
===========

         Kiss me     Close your eyes
Fr -> 13 12 13 -|15 17 18 17 15|
St ->   1  1   1 -|  1   1   1  1   1|

         Miss me    Close your eyes
Fr -> 13 12 13 -|15 17 18 17|
St ->   1  1   1 -|  1   1   1  1|

         I can read your lips
Fr -> 13 15 17 15 17 13 -|
St ->   1  1   1   1   1   1 -|

         On your finger tips
Fr -> 13 15 13 15 12 -|
St ->   1   1  1   1   1 -|

         I can read your smile
Ft -> 13 15 17 20 13 -|
St ->   1   1  1   1   1 -|

         Come on your lips
Fr -> 13 15 18 12 -|
St ->   1   1   1  1 -|

         And happiness in your eyes
Fr -> 15 15 18 18 17 18 17 15|
St ->   2  2   1   1   1   1   1  1|



The song has been demonstrated in the below video. If you find any difficulty playing the above tabs then please have a look at this video ↓↓↓


Wednesday, November 7, 2018

4. Sei Tumi

Strumming Pattern -> DD DUUDUD | DU
                                |__________| |__|
                                 Main Strumming    Filler

      [C]
      Shei tumi keno eto ochena hole
Fr -> 5 5 5 7 7 6 5 7 5 7 8 5|
St -> 4 4 3 3 3 2 2 3 3 5 5 4|

      [Cm7]
      Shei ami keno tomake dukkho dile
                         s                   s
                       ----                ---
Fr -> 5 5 5 7 7 7 10 9 7 9 7 7 7 4|
St -> 4 4 3 3 3 3  3 3 3 3 3 3 3 3|

      [C]
      Kemon kore eto ochena hole tumi
Fr -> 5 5 5 7 6 5 7 5 5 7 7 8 5|
St -> 4 4 3 3 2 2 3 3 3 5 5 5 3|

      [G]
      Kivabe eto bodle gechi ei ami
                         s
                       ----             h
Fr -> 5 5 5 7 7 7 10 9 7 9 7 9 7 7|
St -> 4 4 3 3 3 3  3 3 3 3 3 3 3 3|

             [C]     [Em]                         [Am]
      Ooo bukeri shob koshto du haate shoriye
          s                     s s       s
         ---          p       -----    ---
Fr -> 7 4 4 5 5 5 4 4 4 9 4 4 7 9 7 7|
St -> 3 3 3 3 3 3 3 3 3 3 3 3 4 4 4 4|

               [Dm]
      Cholo bodle jai
                  s
                 ---
Fr -> 9 9 7 9 7 7|
St -> 3 3 3 3 3 3|

                      [Dm]     [F]                       [G]
      Tumi keno bojhona tomake chara ami oshohaye
                            p                     h
Fr -> 7 7 5 5 5 6 6 6 5 5 6 6 6 6 5 6 7 7|
St -> 3 3 2 2 2 2 2 2 2 2 2 2 2 2 2 2 3 3|

               [C]          [Em]          [Am]
      Amar shob tuku bhalobasha tomaye ghire
Fr -> 5 7 7 9 9 9 9 10 10 9 9 9 7 7|
St -> 3 3 3 3 3 3 3  2  2 3 3 3 3 4|

               [Dm]     [F]                 [G]
      Amar oporadh chilo joto tuku tomar kache
                            p                             h
Fr -> 7 9 9 10 10 10 9 9 10 10 10 10 9 10 7 7|
St -> 3 3 3  3  3  3 3 3  3  3  3  3 3  3 3 3|

              [C]             [Em]  [C]
      Tumi khoma kore diyo amay
               s                s
              ---             ---
Fr -> 5 7 7 8 8 8 8 7 7 4 4 5|
St -> 3 3 3 3 3 3 3 3 3 3 3 3|

      [C]                [Em]
      Koto raat Ami kedechi
           p
Fr -> 5 4 4 5 -|5 7 4 7 9|
St -> 3 3 3 3 -|3 3 3 4 4|

   [Am]              [C]
   Buker gobhire Koshto niye
Fr -> 7 9 10 9 7|7 7 7 10|
St -> 4 4  4 4 4|4 4 5  5|

 [C]              [Em]
 Shunyo taye Dube gechi ami
                            p h
Fr -> 5 4 5 5|5 7 5 4 5 7 9|
St -> 3 3 3 3|3 3 3 3 3 4 4|

      [Am]                 [C]
      Amake tumi       Firiye dao
                        p h
Fr -> 7 7 9 10 9 7 9|7 7 7 10|
St -> 4 4 4  4 4 4 4|4 4 5  5|

                      [Dm]     [F]                       [G]
      Tumi keno bojhona tomake chara ami oshohaye
                            p                     h
Fr -> 7 7 5 5 5 6 6 6 5 5 6 6 6 6 5 6 7 7|
St -> 3 3 2 2 2 2 2 2 2 2 2 2 2 2 2 2 3 3|

               [C]          [Em]          [Am]
      Amar shob tuku bhalobasha tomaye ghire
Fr -> 5 7 7 9 9 9 9 10 10 9 9 9 7 7|
St -> 3 3 3 3 3 3 3  2  2 3 3 3 3 4|

               [Dm]     [F]                 [G]
      Amar oporadh chilo joto tuku tomar kache
                            p                             h
Fr -> 7 9 9 10 10 10 9 9 10 10 10 10 9 10 7 7|
St -> 3 3 3  3  3  3 3 3  3  3  3  3 3  3 3 3|

              [C]             [Em]  [C]
      Tumi khoma kore diyo amay
               s               s
              ---             ---
Fr -> 5 7 7 8 8 8 8 7 7 4 4 5|
St -> 3 3 3 3 3 3 3 3 3 3 3 3|

      [C]                       [Em]
      Jotobar   Bhebechi bhule jabo

Fr -> 5 4 5 -|5 5 7 4 4 7 9|
St -> 3 3 3 -|3 3 3 3 3 4 4|

      [Am]                      [C]
      Tar o beshi     Mone pore jaye
Fr -> 7 7 9 10 9 7|7 7 7 7 10|
St -> 4 4 4  4 4 4|4 4 4 5  5|

    [C]                         [Em]
    Fele asha Shei shob din gulo

                            p h
Fr -> 5 4 5 5|5 7 5 4 5 7 9|
St -> 3 3 3 3|3 3 3 3 3 4 4|

      [Am]                  [C]
      Bhule jete ami Parina

                        p h
Fr -> 7 7 9 10 9 7 9|7 7 7 10|
St -> 4 4 4  4 4 4 4|4 4 5  5|

                      [Dm]     [F]                       [G]
      Tumi keno bojhona tomake chara ami oshohaye
                            p                     h
Fr -> 7 7 5 5 5 6 6 6 5 5 6 6 6 6 5 6 7 7|
St -> 3 3 2 2 2 2 2 2 2 2 2 2 2 2 2 2 3 3|

               [C]          [Em]          [Am]
      Amar shob tuku bhalobasha tomaye ghire
Fr -> 5 7 7 9 9 9 9 10 10 9 9 9 7 7|
St -> 3 3 3 3 3 3 3  2  2 3 3 3 3 4|

               [Dm]     [F]                 [G]
      Amar oporadh chilo joto tuku tomar kache
                           p                              h
Fr -> 7 9 9 10 10 10 9 9 10 10 10 10 9 10 7 7|
St -> 3 3 3  3  3  3 3 3  3  3  3  3 3  3 3 3|

              [C]             [Em]  [C]
      Tumi khoma kore diyo amay
               s                s
              ---             ---
Fr -> 5 7 7 8 8 8 8 7 7 4 4 5|
St -> 3 3 3 3 3 3 3 3 3 3 3 3|



The song has been demonstrated in the below video. If you find any difficulty playing the above tabs then please have a look at this video ↓↓↓


Saturday, November 3, 2018

32. WAP to find the largest number using Ternary Operator.

#include<stdio.h>
#include<conio.h>
void main()
{
   int a,b,c,max;
   printf("Enter 3 numbers: ");
   scanf("%d%d%d",&a,&b,&c);
   max= a>b ? (a>c?a:c) : (b>c?b:c);
   printf("\nThe largest number is %d",max);
   getch();
}


Output:






Please have a look at the below lesson posted on my YouTube channel:

26. WAP to determine the quadrant in which a point lies.

#include<stdio.h>
#include<conio.h>
void main()
{
   int x,y;
   printf("Enter the X co-ordinate of the point: ");
   scanf("%d",&x);
   printf("Enter the Y co-ordinate of the point: ");
   scanf("%d",&y);
   if(x!=0 && y==0)
    printf("\nPoint lies on the x-axis");
   else if(x==0 && y!=0)
    printf("\nPoint lies on the y-axis");
   else if(x>0)
   {
    if(y>0)
          printf("\nPoint lies in the first quadrant.");
else
           printf("\nPoint lies in the fourth quadrant.");
   }
   else if(x<0)
   {
    if(y>0)
          printf("\nPoint lies in the second quadrant.");
else
           printf("\nPoint lies in the third quadrant.");
   }
   else
    printf("\nPoint lies at the origin.");
   
   /*
   if(x!=0 && y==0)
    printf("\nPoint lies on the x-axis");
   else if(x==0 && y!=0)
    printf("\nPoint lies on the y-axis");
   else if(x>0 && y>0)
    printf("\nPoint lies in the first quadrant.");
   else if(x<0 && y>0)
    printf("\nPoint lies in the second quadrant.");
   else if(x<0 && y<0)
    printf("\nPoint lies in the third quadrant.");
   else if(x>0 && y<0)
    printf("\nPoint lies in the fourth quadrant.");
   else
    printf("\nPoint lies at the origin.");
   */

   getch();
}


Output:





Please have a look at the below lesson posted on my YouTube channel:

3. Ek Pyar Ka Nagma Hain

        Ek pyar ka..     Maujon ki rawaani..
                                      s
                                     ---          p h
Fr -> 5 7 5 6 8 6 5 -|5 7 7 9 9 6 8 6 8 6 5|
St -> 3 3 2 2 2 2 2 -|3 3 3 3 3 2 2 2 2 2 2|

  Zindagi aur Kuch bhi nahi Teri meri kahaani hai                                                                                                       s s
                       p h    p                     -----
Fr -> 5 6 8 7|7 5 7 8 6 6 5|8 6 7 8 8 6 8 6 5|
St -> 2 2 2 1|1 1 1 2 2 2 1|2 2 3 2 2 2 2 2 2|

        Ek pyar ka..     Maujon ki rawaani..
                s                     s
              ----                  ---          p h
Fr -> 5 7 7 9 6 8 6 5|5 7 7 9 9 6 8 6 8 6 5|
St -> 3 3 3 3 2 2 2 2|3 3 3 3 3 2 2 2 2 2 2|

        Kuchh paakar khona hai
                   s
                 -----      p  h
Fr -> 5 8 8 8 10 10 8 10 7 -|
St -> 2 1 1 1   1  1 1   1 1 -|

        Kuchh kho kar paana hai
                   s
                 -----       p  h
Fr -> 5 8 8 8 12 12 10 12 7 -|
St -> 2 1 1 1   1  1   1  1 1 -|

        Jeevan ka matlab to
               s
              ---           p h
Fr -> 8 5 5 6 6 6 8 6 8 6 5|
St -> 2 1 1 1 1 1 1 1 1 1 1|

         Aana aur jaana hai
               s                   s
              ---                ---
Fr -> 5 8 5 8 8 8 5 5 8 8 6 -|
St -> 1 2 1 1 1 2 1 1 2 2 2 -|

        Kuchh paakar khona hai
                   s
                 -----      p  h    h (till vibration exists)
Fr -> 5 8 8 8 10 10 8 10 7 8|
St -> 2 1 1 1  1  1 1  1 1 1|

        Kuchh kho kar paana hai
                    s
                 -----       p  h     h (till vibration exists)
Fr -> 5 8 8 8 12 12 10 12 7 8|
St -> 2 1 1 1  1  1  1  1 1 -1

        Jeevan ka matlab to
                            p h    h (till vibration exists)
Fr -> 8 5 5 6 6 8 6 8 6 5 6|
St -> 2 1 1 1 1 1 1 1 1 1 1|

         Aana aur jaana hai
                s                  s
              ----               ---
Fr -> 5 8 5 8 8 8 5 5 8 8 6 -|
St -> 1 2 1 1 1 2 1 1 2 2 2 -|

  Do pal ke jeevan se Ek umr churaani hai
                s                    s
               ---                  ---          p h
Fr -> 5 7 7 9 6 8 6 5|5 7 7 9 9 6 8 6 8 6 5|
St -> 3 3 3 3 2 2 2 2|3 3 3 3 3 2 2 2 2 2 2|

  Zindagi aur Kuch bhi nahi Teri meri kahaani hai
                       p h    p                        p h
Fr -> 5 6 8 7|7 5 7 8 6 6 5|8 6 7 8 8 8 6 8 6 5|
St -> 2 2 2 1|1 1 1 2 2 2 1|2 2 3 2 2 2 2 2 2 2|

        Ek pyar ka..      Maujon ki rawaani..
                s                     s
              ----                  ----         p h
Fr -> 5 7 7 9 6 8 6 5|5 7 7 9 9 6 8 6 8 6 5|
St -> 3 3 3 3 2 2 2 2|3 3 3 3 3 2 2 2 2 2 2|


The song has been demonstrated in the below video. If you find any difficulty playing the above tabs then please have a look at this video ↓↓↓

27. WAP to calculate the profit and loss incurred.

#include<stdio.h>
#include<conio.h>
void main()
{
   float cp,sp,profit,loss,profit_per,loss_per;
   printf("Enter the Cost Price of the item: Rs. ");
   scanf("%f",&cp);
   printf("Enter the Selling Price of the item: Rs. ");
   scanf("%f",&sp);
   if(sp>cp)
   {
      profit=sp-cp;
      profit_per=profit/cp*100;
      printf("\nA Profit of %0.2f% has been made.",profit_per);
   }
   else if(cp>sp)
   {
      loss=cp-sp;
      loss_per=loss/cp*100;
      printf("\nA Loss of %0.2f% has been made.",loss_per);
   }
   else
      printf("\nNo loss no profit.");
   getch();
}


Output:




Please have a look at the below lesson posted on my YouTube channel: