Challenge: Three Lines About Me

Lab C Beginner 10 points

Print these three lines, exactly as shown:

Name: Sam
City: Pune
Hobby: Chess

Input

None.

Output

The three lines above.

Example

Output

Name: Sam
City: Pune
Hobby: Chess
Sample output available
Editor
C

Hints

One printf per line is easiest.

Don't forget \n at the end of each line.

Solution explanation

Each printf prints one line because each one ends with \n.

Show solution
#include <stdio.h>

int main() {
    printf("Name: Sam\n");
    printf("City: Pune\n");
    printf("Hobby: Chess\n");
    return 0;
}
Output
Answer
HOME LABS COMMUNITY DASHBOARD