I have just started to teach myself C, and i have been going through the exercises in this book and they have this script
Code:
#include <stdio.h>
main()
{
int age;
float weight;
char first[15], last[15];
printf("\nWhat is your first name?"); /* A prompt*/
scanf(" %s", first);
printf("What is your last name?");
scanf(" %s", last);
printf("How old are you? ");
scanf(" %d", &age);
printf("How much do you weigh? ");
scanf(" %f", &weight);
printf("\nHere is the information you entered:\n");
printf("Name; %s %s\n", first, last);
printf("weight; %.0f\n", weight);
printf("Age; %d", age);
return 0;
}
am i doing something wrong or is the book just missing a step
thanks
greenlazer

