Errors: expected identifier and others

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)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// 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 if int = low;
printf("You have chosen low orange");
else if char = (orange + int);
and if int = 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.

For the syntax of if..else, see http://www.cplusplus.com/doc/tutorial/control/
Topic archived. No new replies allowed.