Hey i have completed the majority of my work needed but i just have these two problems. They are both very short. I hope someone will be able to help me with the codes.
1. Write the definition of a function printAttitude, which has an int parameter and returns nothing. The function prints a message to standard output depending on the value of its parameter.
If the parameter equals 1, the function prints disagree.
If the parameter equals 2, the function prints no opinion.
If the parameter equals 3, the function prints agree.
In the case of other values, the function does nothing.
Each message is printed on a line by itself.
I tried this but it is incorect.....
For the code above i get an error that says "Make sure you have a set of properly working conditionals in your code."Code:void printAttitude(int k) { int k; scanf("%d", &k); if(k=1) printf("disagree\n"); else if(k=2) printf("no opinion\n"); else if(k=3) printf("agree\n"); }
and 2. Write the definition of a function printGrade, which has a char parameter and returns nothing. The function prints on a line by itself the message string Grade: followed by the char parameter (printed as a character) to standard output. Don't forget to put a new line character at the end of your line.
Thus, if the value of the parameter is 'A', the function prints out Grade: A
I have no idea where to begin this one.
Thanx for all your help guys.