#include <stdio.h> int main(void) { char metal; char second_element; char chemical1; char chemical2; int number_of_names = 0; int compound = 0; char prefix; char prefix1; char prefix2; int subscript1 = 0; int subscript2 = 0; int charge1 = 0; int charge2 = 0; int tert = 0; char tertbin; //find charges of anion if (second_element == 'phosphate') charge2 = 3; chemical2 = '(PO4)'; tert = 1; if (second_element == 'sulfate') charge2 = 2;chemical2 = '(SO4)'; tert = 1; if (second_element == 'carbonate') charge2 = 2;chemical2= '(CO3)'; tert = 1; if (second_element == 'nitrate') charge2 = 1; chemical2 = '(NO3)'; tert = 1; if (second_element == 'hydroxide') charge2 = 1; chemical2 = '(OH)'; tert = 1; if (second_element == 'Carbide') charge = 4; chemical2 = 'C'; tert = 0; if (second_element == 'Nitride') charge2 = 3; chemical2 = 'N'; tert = 0; if (second_element == 'Oxide') charge2 = 2; chemical2 = 'O'; tert = 0; if (second_element == 'Phosphide') charge2 = 3; chemical2 = 'P'; tert = 0; if (second_element == 'Sulfide') charge2 = 2; chemical2 = 'S'; tert = 0; if (second_element == 'Chloride') charge2 = 1; chemical2 = 'Cl'; tert = 0; if (second_element == 'Fluoride') charge2 = 1; chemical2 = 'F'; tert = 0; if (second_element == 'Bromide') charge2 = 1; chemical2 = 'Br'; tert = 0; if (second_element == 'Iodide') charge2 = 1; chemical2 = 'I'; tert = 0; return 0; }
Standard input is empty
prog.c: In function 'main':
prog.c:21:27: warning: character constant too long for its type
if (second_element == 'phosphate') charge2 = 3; chemical2 = '(PO4)'; tert = 1;
^
prog.c:21:65: warning: character constant too long for its type
if (second_element == 'phosphate') charge2 = 3; chemical2 = '(PO4)'; tert = 1;
^
prog.c:21:65: warning: overflow in implicit constant conversion [-Woverflow]
prog.c:22:27: warning: character constant too long for its type
if (second_element == 'sulfate') charge2 = 2;chemical2 = '(SO4)'; tert = 1;
^
prog.c:22:62: warning: character constant too long for its type
if (second_element == 'sulfate') charge2 = 2;chemical2 = '(SO4)'; tert = 1;
^
prog.c:22:62: warning: overflow in implicit constant conversion [-Woverflow]
prog.c:23:27: warning: character constant too long for its type
if (second_element == 'carbonate') charge2 = 2;chemical2= '(CO3)'; tert = 1;
^
prog.c:23:63: warning: character constant too long for its type
if (second_element == 'carbonate') charge2 = 2;chemical2= '(CO3)'; tert = 1;
^
prog.c:23:63: warning: overflow in implicit constant conversion [-Woverflow]
prog.c:24:27: warning: character constant too long for its type
if (second_element == 'nitrate') charge2 = 1; chemical2 = '(NO3)'; tert = 1;
^
prog.c:24:63: warning: character constant too long for its type
if (second_element == 'nitrate') charge2 = 1; chemical2 = '(NO3)'; tert = 1;
^
prog.c:24:63: warning: overflow in implicit constant conversion [-Woverflow]
prog.c:25:27: warning: character constant too long for its type
if (second_element == 'hydroxide') charge2 = 1; chemical2 = '(OH)'; tert = 1;
^
prog.c:25:65: warning: multi-character character constant [-Wmultichar]
if (second_element == 'hydroxide') charge2 = 1; chemical2 = '(OH)'; tert = 1;
^
prog.c:25:65: warning: overflow in implicit constant conversion [-Woverflow]
prog.c:26:27: warning: character constant too long for its type
if (second_element == 'Carbide') charge = 4; chemical2 = 'C'; tert = 0;
^
prog.c:26:38: error: 'charge' undeclared (first use in this function)
if (second_element == 'Carbide') charge = 4; chemical2 = 'C'; tert = 0;
^
prog.c:26:38: note: each undeclared identifier is reported only once for each function it appears in
prog.c:27:27: warning: character constant too long for its type
if (second_element == 'Nitride') charge2 = 3; chemical2 = 'N'; tert = 0;
^
prog.c:28:27: warning: character constant too long for its type
if (second_element == 'Oxide') charge2 = 2; chemical2 = 'O'; tert = 0;
^
prog.c:29:27: warning: character constant too long for its type
if (second_element == 'Phosphide') charge2 = 3; chemical2 = 'P'; tert = 0;
^
prog.c:30:27: warning: character constant too long for its type
if (second_element == 'Sulfide') charge2 = 2; chemical2 = 'S'; tert = 0;
^
prog.c:31:27: warning: character constant too long for its type
if (second_element == 'Chloride') charge2 = 1; chemical2 = 'Cl'; tert = 0;
^
prog.c:31:64: warning: multi-character character constant [-Wmultichar]
if (second_element == 'Chloride') charge2 = 1; chemical2 = 'Cl'; tert = 0;
^
prog.c:31:64: warning: overflow in implicit constant conversion [-Woverflow]
prog.c:32:27: warning: character constant too long for its type
if (second_element == 'Fluoride') charge2 = 1; chemical2 = 'F'; tert = 0;
^
prog.c:33:27: warning: character constant too long for its type
if (second_element == 'Bromide') charge2 = 1; chemical2 = 'Br'; tert = 0;
^
prog.c:33:63: warning: multi-character character constant [-Wmultichar]
if (second_element == 'Bromide') charge2 = 1; chemical2 = 'Br'; tert = 0;
^
prog.c:33:63: warning: overflow in implicit constant conversion [-Woverflow]
prog.c:34:27: warning: character constant too long for its type
if (second_element == 'Iodide') charge2 = 1; chemical2 = 'I'; tert = 0;
^
prog.c:18:6: warning: unused variable 'tertbin' [-Wunused-variable]
char tertbin;
^
prog.c:17:5: warning: variable 'tert' set but not used [-Wunused-but-set-variable]
int tert = 0;
^
prog.c:16:5: warning: variable 'charge2' set but not used [-Wunused-but-set-variable]
int charge2 = 0;
^
prog.c:15:5: warning: unused variable 'charge1' [-Wunused-variable]
int charge1 = 0;
^
prog.c:14:5: warning: unused variable 'subscript2' [-Wunused-variable]
int subscript2 = 0;
^
prog.c:13:5: warning: unused variable 'subscript1' [-Wunused-variable]
int subscript1 = 0;
^
prog.c:12:6: warning: unused variable 'prefix2' [-Wunused-variable]
char prefix2;
^
prog.c:11:6: warning: unused variable 'prefix1' [-Wunused-variable]
char prefix1;
^
prog.c:10:6: warning: unused variable 'prefix' [-Wunused-variable]
char prefix;
^
prog.c:9:5: warning: unused variable 'compound' [-Wunused-variable]
int compound = 0;
^
prog.c:8:5: warning: unused variable 'number_of_names' [-Wunused-variable]
int number_of_names = 0;
^
prog.c:7:6: warning: variable 'chemical2' set but not used [-Wunused-but-set-variable]
char chemical2;
^
prog.c:6:6: warning: unused variable 'chemical1' [-Wunused-variable]
char chemical1;
^
prog.c:4:6: warning: unused variable 'metal' [-Wunused-variable]
char metal;
^
Standard output is empty