I am trying to teach myself to program in C, I do not understand the error's that I am getting. I am using Code Blocks on a Window's Machine. Could someone please explain the errors I am getting, and why, as well as any idea's for improvement.
Note: this is not the full program (the rest is still in progress) this is what I have done so far but I am stuck. (BOLD = to notate where the errors begin and end)
// This is the sample of the karate program
/* By Carrie Crisp, 2014 */
// Filename orangebelt.c
#include <stdio.h>
main()
{
// My variables for this program
char orange;
int low,high;
/*variables to hold beltcolor*/
float loworange,highorange;
/*Asks the user to input a belt color */
printf("what is the rank low or high?");
scanf("%f",&low);
scanf("%f",&high);
printf("what is the color of belt you want to study?");
char = (orange + int);
and ifint = low;
printf("You have chosen low orange");
elseifchar = (orange + int);
and ifint = high;
printf("You have chosen high orange");
// takes user input and outputs result
return 0;
}
char = (orange + int);
'char' is a type. You cannot assign to a type. You can assign to a named variable. You have declared five named variables on lines 9,10,14.
'int' is a type. Addition expects the name of a variable (or a function call that returns a value that can be added). Besides, the variable 'orange' does not have any known value yet.