I don't know why my code is failing after building, actually i know the char statements are wrong can anyone tell me how i can fix the char statements and make them correct, all i need to do is initialize a single letter using char

#include <stdio.h>


int main() {
// initialize variables needed for user inputs and calculations
	int grade1 = 0;
	int grade2 = 0;
	int grade3 = 0;
	int grade4 = 0;
	int midterm = 0;
	int attendence = 0;
	int totalPoints = 0;
	int gradepercentage = 0;
	int total = 0;
	char grade1 = 'A';    // this is where it fails
	char grade2 = 'B';
	char grade3 = 'C';
	char grade4 = 'D';

Everything posted is fine.

> Everything posted is fine.

You sure?

int grade1 = 0;
	char grade1 = 'A';    // this is where it fails

Ahhh, I see...

i actually found that out right after i posted this , thats why i had it as solved but thank you for pointing it out.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.