Ask Question

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;

}

+1
Answers (1)
  1. 16 April, 09: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 & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers