Error | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Error

#include <stdio.h> int main() { int a, b, c; float salary = 56.23; char letter = 'Z'; a = 8; b = 34; int c = a+b; printf("%d \n", c); printf("%f \n", salary); printf("%c \n", letter); return 0; } where is error???

5th May 2020, 8:06 PM
ABHRADIP MONDAL
ABHRADIP MONDAL - avatar
4 Answers
0
The error says redeclaration of c,why did you declared int c two times ?
5th May 2020, 8:09 PM
Abhay
Abhay - avatar
0
The error is in the declaration of "c" variable twice .
5th May 2020, 8:19 PM
Dasarath Singh
0
after declaring c in once... it comes error in main function...
6th May 2020, 10:30 AM
ABHRADIP MONDAL
ABHRADIP MONDAL - avatar
0
You have declared variable 'c' two times. 1) int a,b,c; 2) int c= a+b; That's why you are getting the ERROR.
6th May 2020, 2:32 PM
Dasarath Singh