View Single Post
  #2 (permalink)  
Old 06-28-2007, 11:17 AM
siLenTz's Avatar
siLenTz siLenTz is offline
Jr. Programmer
Awards Showcase
Quality Tutorial Quality Tutorial Quality Tutorial Quality Tutorial 
Total Awards: 4
Join Date: Jun 2007
Posts: 87
iTrader: (0)
siLenTz will become famous soon enoughsiLenTz will become famous soon enough
I am C++ programmer, and I think your code is in C right? It is little bit
messy. I think you should use switch() instead of using too many
elseif. Try this

Code:
switch(shape) {
   case 't':

      printf ("\nPlease enter the base of the triangle:");
        scanf ("%f", &num);
       printf ("\nPlease enter the height of the triangle:");
       scanf ("%f", &num2);
       total= 0.5 * num * num2;
       printf ("area= 0.5 * %d * %d = %d", num, num2, total);
      break;

    case 'c':

     // your code....
     break;

    default:
         printf ("\n I do not know that letter that was inputed please try again!");
}
Anyway, is it syntax error or logical error? If it is syntax error pleae
post your errors in here. if it is logical error then tell what happen.

__________________

Digg this Post! Del.Icio.Us this Post! Technorati this Post! Furl this Post! Mister Wong this Post! Newsvine this Post! Spurl this Post! Reddit this Post! Netscape this Post!
Reply With Quote