fr
fr

Question from the Language C - Fundamentals test

Write a C program that prints the name, age, and height of a person.

Waiting for validation
Original question

What does the following code display?

    int main() 
    {     
        char name[]; 
        int age = 18; 
        double height= 1.75;
        scanf(“%s”, name);
        printf(“%d/n%f/n%s/n”,age,height,name);
        
        return 0;    
    }
New question

What does the following code display?

    #include <stdio.h>
    int main() 
    {     
        char name[255]; 
        int age = 18; 
        double height= 1.75;
        scanf("%s", name);
        printf("%d\n%f\n%s\n",age,height,name);
        
        return 0;    
    }
Author: Thibault JochemStatus: Waiting for validation(Update)Question not yet passed
0
Community EvaluationsNo one has reviewed this question yet, be the first!