Page 5 of 9 FirstFirst ... 2345678 ... LastLast
Results 41 to 50 of 82
  1. #41

    bacn wala nako natarong ug copy kang smarkies. i-try lng na kang smarkies peru ibaylo lng ang order sa input

  2. #42
    Copied the original code by smarkies and edited..

    The same result ra giahpon bro. T_T I think I'll have to go with the magic line nga
    Code:
    void main(void);
    {
     .
     ..
     ...
     printf("Choices: ... ");
     c=getche();
    }
    Anyways, naka decide diay ko nga ang corrected program ni smarkies (original one) ang akong gamiton kay simple ra (Bahala na nagbaylo ang order sa paginput.. ). If I will use man gud the other programs introduced to me, musaka nya ang kilay sa among maestra ngano advanced kaayo akong program. xD

    Nonetheless, I would like to express my eternal gratitude to all programmers who patiently helped me in my endeavor. MABUHAY KAYONG LAHAT!
    Last edited by marcdaven; 02-11-2010 at 11:11 PM. Reason: Final adopted program

  3. #43
    I managed to compile a c program under visual studio 2008. pwede ra mn diay isulod sa c++ file/project.

    i think mao na ni. i found out nga case sensitive ang compiler so instead of if(c=='A'), use if(c=='a')... I'm not sure though but mao akong na-obserbahan sa akong compiler. hehe

    PHP Code:
    #include<stdio.h>
    #include<conio.h>
    int add(intint);
    int subtract(intint);
    float divide(intint);
    int multiply(intint);

    int main()
    {
     
    int abdef;
     
    float g;
     
    char c;
     
     
    printf("\nEnter two integers separated by a space: ");
     
    scanf("%d %d", &a, &b);

     
    printf("Select an operation:\n(a) Add\n(s) Subtract\n(d) Divide\n(m) Multiply\n");
     
    printf("Choice: ");
     
    scanf("%c",&c);

     
    getche();

     if (
    c=='a')
     {
      
    d=add(ab);
      
    printf("\nThe sum of %d and %d is %d\n"abd);
      
     }

     if (
    c=='s')
     {
      
    e=subtract(ab);
      
    printf("\nThe difference of %d and %d is %d\n"abe);  
     }

     if (
    c=='d')
     {
      
    g=divide(ab);
      
    printf("\nThe quotient of %d and %d is %.2f\n"abg);  
     }

     if (
    c=='m')
     {
      
    f=multiply(ab);
      
    printf("\nThe product of %d and %d is %d\n"abf);  
     }
     
    getch();
     return 
    0;
    }


    int add(int aint b)
    {
     return (
    a+b);
    }
    int subtract(int aint b)
    {
     return (
    a-b);
    }
    int multiply(int aint b)
    {
     return (
    a*b);
    }
    float divide(int aint b)
    {
     return ((float)
    a/b);


  4. #44
    if you want to be sure kung case sensitive ba ang input.
    use
    PHP Code:
    if (c=='a' || c=='A')
    {
       
    d=add(ab); 
       
    printf("\nThe sum of %d and %d is %d\n"abd);


  5. #45
    Quote Originally Posted by xiao_xiao View Post
    I managed to compile a c program under visual studio 2008. pwede ra mn diay isulod sa c++ file/project.

    i think mao na ni. i found out nga case sensitive ang compiler so instead of if(c=='A'), use if(c=='a')... I'm not sure though but mao akong na-obserbahan sa akong compiler. hehe

    PHP Code:
    #include<stdio.h>
    #include<conio.h>
    int add(intint);
    int subtract(intint);
    float divide(intint);
    int multiply(intint);

    int main()
    {
     
    int abdef;
     
    float g;
     
    char c;
     
     
    printf("\nEnter two integers separated by a space: ");
     
    scanf("%d %d", &a, &b);

     
    printf("Select an operation:\n(a) Add\n(s) Subtract\n(d) Divide\n(m) Multiply\n");
     
    printf("Choice: ");
     
    scanf("%c",&c);

     
    getche();

     if (
    c=='a')
     {
      
    d=add(ab);
      
    printf("\nThe sum of %d and %d is %d\n"abd);
      
     }

     if (
    c=='s')
     {
      
    e=subtract(ab);
      
    printf("\nThe difference of %d and %d is %d\n"abe);  
     }

     if (
    c=='d')
     {
      
    g=divide(ab);
      
    printf("\nThe quotient of %d and %d is %.2f\n"abg);  
     }

     if (
    c=='m')
     {
      
    f=multiply(ab);
      
    printf("\nThe product of %d and %d is %d\n"abf);  
     }
     
    getch();
     return 
    0;
    }


    int add(int aint b)
    {
     return (
    a+b);
    }
    int subtract(int aint b)
    {
     return (
    a-b);
    }
    int multiply(int aint b)
    {
     return (
    a*b);
    }
    float divide(int aint b)
    {
     return ((float)
    a/b);

    Bro, ganahan man gud ang among maestra nga void main(void) among gamiton..
    Then, I don't know if pwede ba mugamit ug getche(); kay wala pa man na gitudlo sa amo bro..

  6. #46
    Quote Originally Posted by xiao_xiao View Post
    if you want to be sure kung case sensitive ba ang input.
    use
    PHP Code:
    if (c=='a' || c=='A')
    {
       
    d=add(ab); 
       
    printf("\nThe sum of %d and %d is %d\n"abd);

    Hala, bitaw sa.. Pwede pa man diay ma modify ang input, pwede ra capatial A ba or di.. Thanks ani nga idea!

  7. #47
    aw pwede ra mn void main(void).
    int main() mn gud to ako sauna.
    kung mag void ka, ayaw na pag return 0;
    pwede ra mn cguro getche(); hehe

  8. #48
    pwede ra mn cguro na ilisan nimo ug getch() instead of getche()... specifically c = getch();
    ok ra mn sa akong compiler. awat2x ra mn ko anang getche() sa mga uban ga post diri. hehe.

  9. #49
    Haha! Di ko ganahan mugamit ug program nga wla ko naka sabot sa each part sa program. xD

  10. #50
    revised...
    getch() na akong gamit, dili na getche... tapos case insensitive na.
    PHP Code:
    #include<stdio.h>
    #include<conio.h>
    int add(intint);
    int subtract(intint);
    float divide(intint);
    int multiply(intint);

    int main()
    {
     
    int abdef;
     
    float g;
     
    char c;
     
     
    printf("Enter two integers separated by a space: ");
     
    scanf("%d %d", &a, &b);

     
    printf("Select an operation:\n(a) Add\n(s) Subtract\n(d) Divide\n(m) Multiply\n");
     
    printf("Choice: ");
     
    scanf("%c",&c);

     
    getch();

     if (
    c=='a' || c=='A')
     {
      
    d=add(ab);
      
    printf("\nThe sum of %d and %d is %d\n"abd);  
     }

     if (
    c=='s' || c=='S')
     {
      
    e=subtract(ab);
      
    printf("\nThe difference of %d and %d is %d\n"abe);  
     }

     if (
    c=='d' || c=='D')
     {
      
    g=divide(ab);
      
    printf("\nThe quotient of %d and %d is %.2f\n"abg);  
     }

     if (
    c=='m' || c=='M')
     {
      
    f=multiply(ab);
      
    printf("\nThe product of %d and %d is %d\n"abf);  
     }

     
    getch();
     return 
    0;
    }


    int add(int aint b)
    {
     return (
    a+b);
    }
    int subtract(int aint b)
    {
     return (
    a-b);
    }
    int multiply(int aint b)
    {
     return (
    a*b);
    }
    float divide(int aint b)
    {
     return ((float)
    a/b);


  11.    Advertisement

Page 5 of 9 FirstFirst ... 2345678 ... LastLast

Similar Threads

 
  1. Help me in my laptop problem
    By Wenxp7 in forum Computer Hardware
    Replies: 16
    Last Post: 10-08-2010, 07:48 PM
  2. pls help me in my pldt dsl connection...
    By glenntacan in forum Networking & Internet
    Replies: 5
    Last Post: 01-23-2009, 05:15 PM
  3. help me in my front panel config
    By absimon in forum Computer Hardware
    Replies: 5
    Last Post: 12-05-2008, 07:18 PM
  4. Please help me in martial arts.
    By Chalil in forum Sports & Recreation
    Replies: 11
    Last Post: 09-20-2006, 10:52 PM
  5. Where can I repair my flash drive?!!! Help me!!!
    By jonmlas in forum Gizmos & Gadgets (Old)
    Replies: 13
    Last Post: 11-30-2005, 12:36 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
about us
We are the first Cebu Online Media.

iSTORYA.NET is Cebu's Biggest, Southern Philippines' Most Active, and the Philippines' Strongest Online Community!
follow us
#top