Help needed with c language...

Discussion in 'Computer Forum' started by RC_rocks, Mar 17, 2008.

  1. RC_rocks

    RC_rocks New Member

    can one any one help me out wid c language i have a practical day after and i just started wid reading the book its not that tuff.

    but here's my problem i wrote a simple program of mathematical operations using switch statment and i keep getting a error which says :

    Linker error: Undefined symbol '_printf' in module MATHSF~1.c

    This is a image of the tc.exe wid the error :

    [​IMG]


    i can't figure out how to fix this please help.
    This is wat i wrote:


    # include <stdio.h>
    # include <conio.h>

    main()
    {
    int a,b,c,ch;
    clrscr();

    printf ("\n \t\t\t ====================");
    printf ("\n \t\t\t\t MENU");
    printf ("\n \t\t\t ====================");
    printf ("\n \t\t\t [1] Addition");
    printf ("\n \t\t\t [2] Subtraction");
    printf ("\n \t\t\t [3] Multiplication");
    printf ("\n \t\t\t [4] Division");
    printf ("\n \t\t\t [0] Exit(I don't give a sh*t");
    printf ("\n \t\t\t ====================");

    Printf ("\n\n \t\t\t ENTER YOUR CHOICE :");
    scanf ("%d", &ch);

    if (ch<=4 & ch>0)
    {
    printf("Enter Two Numbers :");
    scanf("%d %d",&a,&b);
    }

    switch (ch)
    {
    case 1:
    c=a+b;
    printf ("\n Addition : %d",c);
    break;

    case 2:
    c=a-b;
    printf ("\n Subtraction : %d",c);
    break;

    case 3:
    c=a*b;
    printf ("\n Multiplication : %d",c);
    break;

    case 4:
    c=a/b;
    printf ("\n Division : %d",c);
    break;

    case 0:
    printf ("\n You don't give a sh*t");
    Exit();
    break;
    default:
    printf ("\n Invalid Choice");

    }
    getch();
    }


    Pls help needed asap...
     
  2. g0g0l

    g0g0l ! SpAm

    Line 16: printf ("\n\n \t\t\t ENTER YOUR CHOICE :");

    that'll do i guess... recompile and reply....
     
  3. amitrichardxess

    amitrichardxess New Member

    yaaa sugata is right,
    you wrote "Printf" instead of "printf"
     
  4. g0g0l

    g0g0l ! SpAm

    tht's the saddest thing bout programming... only a small mistake can spoil the whole program :p:
     
  5. RC_rocks

    RC_rocks New Member

    thanks ppl

    hey thanks for the help guys...
    but i found the problem..
    its not the printf, coz i just realised that the compiler was givin the error on the first line only....
    i just read that c wasn't case sensitive except of the variables and constants you declare...

    my compiler had some problem i dled tc3..the program ran on it without any problem..

    buy the way i have started likin c earlier i found it borin but pnce know how little things work you wanna learn more...

    thanks again for the help...
     
  6. g0g0l

    g0g0l ! SpAm

    ^sorry.. dunno that fact... coz i am working with javascript. but, ur switch statement seemed to be perfect, still u told u thought it gave errors. So, tht's the mistake i cud figure out from the similarities of javascript and C....
     

Share This Page