#include <stdio.h>
main(void)
{
    struct computer
    {
        float cost;
        int year;
        int cpu_speed;
        char cpu_type[16];
    } model;
    printf(“The type of the CPU inside your computer?\n”);
    gets(model.cpu_type);
    printf(“The speed(MHz) of the CPU?\n”);
    scanf(“%d”, &model.cpu_speed);
    printf(“The year your computer was made?\n”);
    scanf(“%d”, &model.year);
    printf(“How much you paid for the computer?\n”);
    scanf(“%f”, &model.cost);
    printf(“Here are what you entered:\n”);
    printf(“Year: %d\n”, model.year);
    printf(“Cost: $%6.2f\n”, model.cost);
    printf(“CPU type: %s\n”, model.cpu_type);
    printf(“CPU speed: %d MHz\n”, model.cpu_speed);
    return 0;
}
The above code is from Teach Yourself C in 24 hours,but it shows stray errors while being run.
In the book,an output has also been displayed.
In the output,the cost of the model is $1234.56. How can 1234.56 fit into %6.2f... I mean for %6.2f we'll get only 234.56,right?
 
     
     
     
    