Ask Question
23 May, 17:00

Retype the statements, correcting the syntax errors.

printf ("Num: %d/n", songnum);

printf ("%d/n", int songNum);

printf ("%d songs/n" songNum);

This activity will perform two tests: the first with songNum = 5, the second with songNum = 9

#include

int main (void) {

int songNum;

songNum = 5;

return 0;

}

+4
Answers (1)
  1. 23 May, 20:36
    0
    Answer: Following are the corrected statements as mentioned in question

    printf ("Num: %d/n", songNum);

    printf ("%d/n", songNum);

    printf ("%d songs/n", songNum);

    Explanation:

    In the first statement, small n was used as, c is a case-sensitive programming language, so, songnum and songNum are considered different variable names and here songNum was used. In the second one, int was used. While writing printf statement data type is not used. To mention data type %d is used which shows an integer type variable is printed here. So, int has to be removed. In the last one, ',' was missing, which is a part of the syntax for the printf statement.
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “Retype the statements, correcting the syntax errors. printf ("Num: %d/n", songnum); printf ("%d/n", int songNum); printf ("%d songs/n" ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers