Ask Question
22 May, 03: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;

}

+2
Answers (1)
  1. 22 May, 04:40
    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?
Find 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 and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers