I’m new to C programming and I just came across this program and got a problem. It says it has error on the line I indicated. Can any one help?
#include <stdio.h>
#include <stdlib.h>
#include <conio.h>
int main()
{
float a;
printf("Hello world!\n");
scanf("%d",&a)
printf("you entered: %f",a);//here is the error
getch()
}
I’m using CodeBlocks.
I see two semi-colons missing…
The scanf line needs one also to advise the compiler that the instruction is ending, and you’re likely seeing the error on the next line because it thinks it’s on the previous line still.