I can't seem to get this code working
and I don't really know what errors I have made?
If someone can have a quick look..
and after compiling heres what I get
Thanks.
and I don't really know what errors I have made?
If someone can have a quick look..
Code:
// math.c
// Author: Samuel Gilbert
// Date: 31/7/12
// A simple program computing volume, surface area and total length
#include <stdio.h>
int main(int argc, char * argv[]){
float width, length, height, volume, surface area, edge length
printf("Enter length: ");
printf("Enter width: ");
printf("Enter height: n");
scanf("%f%f%f", &length, &height, &width);
volume = (width*length*height);
printf("volume is %.2f cubic meters\n", volume);
return 0;
}
and after compiling heres what I get
Code:
math.c: In function ‘main’:
math.c:10: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘area’
cc1: warnings being treated as errors
math.c:14: warning: too many arguments for format
math.c:14: warning: too many arguments for format
Thanks.
Last edited by a moderator: