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 :


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

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

    int a,b,c,ch;

    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:
    printf ("\n Addition : %d",c);

    case 2:
    printf ("\n Subtraction : %d",c);

    case 3:
    printf ("\n Multiplication : %d",c);

    case 4:
    printf ("\n Division : %d",c);

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


    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