When i run this code, it does not give me an option to enter in my weight. Instead it goes straight to printing the info i entered what did i do wrong?
Code:
#include <stdio.h>
int main(){
int age;
float weight;
char first[15], last[15]; /* 2 char arrays */
printf("\nWhat is your first name?");
scanf(" %s", first); /* no ampersand on char arrays */
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); /*ampersand required*/
printf("\n");
printf("\nHere is the info you entered;\n");
printf("name: %s %s\n", first, last);
printf("weight: %d", age);
system("pause");
return 0;
}