Reply to Help With Programming
If you don't have an account, just leave the password field blank.
I just started to learn C and I've reached a few hurdles(and apparently my teacher doesn't know what to do either). I was wondering if you guys could help.
1. When I use the modulus operator for floating point variables, it gives me a message that says "Illegal Use Of Float" or gives me a wrong result(when I use both int and float for the operation).
2. I couldn't for the life of me figure out how to add two char and display their sum as the sum of their ASCII values. What I typed is probably wrong but it will give an idea about what I tried to do:
char a, b;
int c;
printf ("Enter Characters");
scanf ("% c% c", &a,&b);
c = a + b;
printf("%d", c);
The output should be something like:
Enter Two Characters:
The Sum Of their ASCII Values Is:
Thanks in advance
1. When I use the modulus operator for floating point variables, it gives me a message that says "Illegal Use Of Float" or gives me a wrong result(when I use both int and float for the operation).
2. I couldn't for the life of me figure out how to add two char and display their sum as the sum of their ASCII values. What I typed is probably wrong but it will give an idea about what I tried to do:
char a, b;
int c;
printf ("Enter Characters");
scanf ("% c% c", &a,&b);
c = a + b;
printf("%d", c);
The output should be something like:
Enter Two Characters:
The Sum Of their ASCII Values Is:
Thanks in advance