Wednesday, February 29, 2012

OPMTUNES.COM

opmtunes - filipino music lyrics with guitar chords

Ikaw Ang Aking Mahal
VST & Co.


Intro: A-C#m7-Bm7-E-
A C#m7 Bm7- E-
(Ah hah hah)

A C#m7 Bm7
Itanong mo sa akin
E A C#m7 Bm7-E-
Kung sino'ng ang aking mahal (ahh hah--)
A C#m7 Bm7
Itanong mo sa akin
E A C#m7 Bm7-E-
Sagot ko'y di magtatagal (ahh hah--)

Chorus
A F#m
Ikaw lang ang aking mahal
Bm7 E7
Ang pag-ibig mo'y aking kailangan
C#m7 F#m7
Pag-ibig na walang hangganan
Bm7 Dm-E-
Ang aking tunay na nararamdaman
A C#m7 Bm7-E-
(Ah hah hah--)

A C#m7 Bm7
Isa lang ang damdamin
E A C#m7-Bm7-E-
Ikaw ang aking mahal
A C#m7 Bm7
Maniwala ka sana
E A-C#m7-Bm7-E-
Sa akin ay walang iba

(Repeat Chorus)

A C#m7 F#
(Ah hah hah--)

Bridge
Bm7 E
Ang nais ko sana'y inyong malaman
C#m7 F#m
Sa hilaga o sa timog o kanluran (o sa silangan)
Bm7
At kahit sa'n pa man
E A C#m7 Bm7
Ang laging isisigaw (ah hah hah--)
E A C#m7 Bm7-F-
Ikaw ang aking mahal (ah hah hah--)
Bb Dm7 Cm7-F-
(ah hah hah--)
Bb Dm7 G
(ah hah hah--)

(Repeat Bridge moving chords 1/2 step higher,
except last line)

Coda
F Bb Dm7 Cm7-F-G
Ikaw ang aking mahal (ah hah hah--)

Monday, February 27, 2012

Pythagorean Theorem on Turbo - C

Case Problem 1:

Turbo c program about the Pythagorean theorem?

Our teacher asked us to make this program.
so its like this:
it prompts the user to press 1 if its looking for a side, 2 for another side, and 3 for the hypotenuse.
then they enter the given data... like if they're looking for the hypotenuse, they enter the values of sides and 2...

then the program displays the answer... i would really appreciate your help... GOD bless.

    Additional Details

    So far... i've made it to solve for a... that is sqrt((c*c)-(b*b)).... it goes perfectly..

    then it continues asking for ANOTHER VARIABLE.... its saying things like: enter value of a... enter b... to solve for c...! (sorry for the opaque explanation... ^^)
    so far... my friend told me to do it like this:

    #include
    #include
    main();
    {
    float a, b, c;
    char choose;(i dont know what this is.. xD)
    clrscr();
    printf("some instructions here");
    printf("choose side you want to solve...");
    scanf ("%c", &choose);
    choose=toupper(choose);
    switch (choose);
    then the solving starts here for a...

    another for b...

    another for c...

    so... i entered a value for c... everything goes well... then b.... then it displays a...

    BUT.... it then proceeds to asking me for the other side... to solve for c... etc..

    i don't get it... i can't even understand what im saying,... xD



    Best Answer - Chosen by Voters

    Even if you can't even understand what you're saying, I think I can guess what your problem is: scanf. My policy is to never use scanf. It leaves the newline in the input stream, which is annoying and leads to exactly the kinds of problems you're trying to describe. Try something like the following code fragment, and I believe all your problems will disappear:

    #define MAX_LINE_LEN 80

    char line[MAX_LINE_LEN];

    do {
        printf("Enter length of side: ");
        fgets(line, MAX_LINE_LEN, stdin);
    } while (sscanf(line, "%f", &a) != 1);


    Case Problem 2: C-language


    /*The Math Program 1.3 Updated 08/31/06. Created by Kenny Ashman*/
    /*****************************************************************
    *This program has three functions besides the main which are for * 
    *The Pythagorean Theorem, Distance Formula and calculating the   *
    *circumference and area of a circle. The main function is used   *
    *only for directing you to the other three functions and is      *
    *returned to if the user enters 0 when prompted for input which  *
    *is explained in the comments below.                             *
    *****************************************************************/
    #include
    #include


    int Pythag();     //function for pythagorean theorem
    int Distance();  //function for distance formula
    int Circle();   //function for circle circumference and area


    main()
    {
          int iSelection=0;
          
          while (iSelection!=4) {    //begin while loop     
          
          system("cls");            //clear screen
          printf("\n\tThe Math Program 1.3");
          printf("\n1:Pythagorean Theorem");
          printf("\n2:Distance Formula");
          printf("\n3:Circle Circumference & Area");
          printf("\n4:Quit");
          printf("\n\nSelect a function:");
          scanf("%d", &iSelection); //function selection
          
          if (iSelection==1) {Pythag();}    //1 for Pythag
          if (iSelection==2) {Distance();} //2 for Distance
          if (iSelection==3) {Circle();}  //3 for Circle
          } //end while loop


    }      //end main function


    int Pythag()       
    {                     //begin Pythag function
         int iSelection;
         float A, B, C;
         
         system("cls");
         printf("\n\tPythagorean Theorem\t(Enter 0 for selection to quit)\n");
         printf("\n1:A");
         printf("\n2:B");
         printf("\n3:C");
              
         while (iSelection==1 || 2 || 3) {  //begin while loop
         
         printf("\nSelection:");
         scanf("%d", &iSelection);   //selecting what you need. A, B or C
         
         if (iSelection==1) {
         
         printf("\nB:");
         scanf("%f", &B);
         printf("C:");
         scanf("%f", &C);
         
         A=sqrt((C*C)-(B*B));   //pythagorean theorem for A
         
         printf("\nA=%f", A);
         printf("\n-----------");
         }
         
         if (iSelection==2) {
         
         printf("\nA:");
         scanf("%f", &A);
         printf("C:");
         scanf("%f", &C);
         
         B=sqrt((C*C)-(A*A));   //pythagorean theorem for B
         
         printf("\nB=%f", B);
         printf("\n-----------");
         }
         
         if (iSelection==3) {
         
         printf("\nA:");
         scanf("%f", &A);
         printf("B:");
         scanf("%f", &B);
         
         C=sqrt((A*A)+(B*B));   //pythagorean theorem for C
         
         printf("\nC=%f", C);
         printf("\n-----------");
         }
         if (iSelection==0) {
         return 0;//if selection = 0 return to the main function
         }
         }//end while     
    }                  //end Pythag function


    int Distance()
    {                 //begin Distance function
         float X1, X2, Y1, Y2, D;
         
         system("cls");     //clear screen
         printf("\n\tDistance Formula\t(Enter 0 for all coordinates to quit)");
         
         while (1==1){  //begin while loop
                   
         printf("\nFirst Point:"); //enter the points
         printf("\nX:");     
         scanf("%f", &X1);
         printf("Y:");
         scanf("%f", &Y1);
         printf("Second Point:");
         printf("\nX:");
         scanf("%f", &X2);
         printf("Y:");
         scanf("%f", &Y2);
         
         if (X1==0, X2==0, Y1==0, Y2==0) {  
         return 0;  //if both points = 0,0 then return to main function
         }
         
         D=sqrt((X2-X1)*(X2-X1)+(Y2-Y1)*(Y2-Y1)); //the distance formula
         
         printf("\nDistance=%f", D);   
         printf("\n-----------------");
         } //end while loop
    }  //end Distance function


    int Circle()
    {                   //begin Circle function
         float Pi=(4*atan(1)); 
         float R, C, SA;
         
         system("cls");    //clear screen
         printf("\n\tCircle Circumference & Surface Area\t(Enter 0 for radius to quit)");
         
         while (1==1) {  //begin while loop (I don't know why I put 1==1 for the condition but whatever, it matters not...I hope)
         
         printf("\nRadius:");
         scanf("%f", &R);  //prompted for the Radius 
         
         if (R==0){
         return 0;//if the radius = 0 return to the main function
         }
         
         C=Pi*R*2;   //formula for circumference
         SA=Pi*R*R; //formula for surface area
         
         printf("Circumference=%f", C);
         printf("\nSurface Area=%f", SA);
         printf("\n-----------------------");
         }//end while
         
    }//end circle function




    Case Problem 3:



    Pythagorean Triplet Problem

    This is a discussion on Pythagorean Triplet Problem within the C Programming forums, part of the General Programming Boards category; I am solving the euler probelm (no. 9) that wants to find the only Pythagorean triplet such that a+b+c = ...




    #include
    #include
    #include
    int main()
    {
        int a,b,c;
        int max = 500;
        int aSquared = pow(a,2);
        int bSquared = pow(b,2);
        int cSquared;
         
        for(a = 1; a < max; a++)
        {
              for(b = 1; b < max; b++)
              {
                    int aSquared = a*a;
                    int bSquared = b*b;
                    cSquared = aSquared + bSquared;
                    c = sqrt(cSquared);
                    if(a
                        printf("%d is a, %d is b, %d is c.\n", a, b, c);
              }
        }
         
        system("PAUSE");
        return 0;
    }


    note: There is no need to redefine 'aSquared' and 'bSquared' as integers within the loop. You already declared them as variables.

    Is there some restriction from using the obvious three nested loops for this problem?

    Not a particularly elegant solution, but it finds the answer in less than one second.




    #include
    #define MAX 500
    int main()
    {
      unsigned long int a,b,c,asqr,bsqr,csqr;
      for(a=1;a
        for(b=1;b
          for(c=1;c
            if(a + b + c == 1000) {
              asqr=a*a;
              bsqr=b*b;
              csqr=c*c;
              if(asqr + bsqr == csqr) {
                printf("\nasqr=%2lu  bsqr=%2lu  csqr=%2lu\n", asqr, bsqr, csqr);
                printf("\nAnswer is: a=%lu b=%lu c=%lu", a,b,c);
                printf("\n\n\t\t\t    press enter when ready");
                (void) getchar();
                return 0;
              }
            }
          }
        }
      }
      printf("\n\n\t\t\t    press enter when ready");
      (void) getchar();
      return 0;
    }