#include <stdio.h>
int main(void)
{
char name[256];
printf ("What's your name?");
scnaf_s("%s", name, sizeof(name));
int age;
printf ("How old are you?");
scanf_s("%d", &age);
float weight;
printf ("Weight?");
scanf_s("%f", &weight);
double height;
printf ("How tall are you?");
scanf_s("%fl", &height);
char what[256];
printf ("What crime?");
scanf_s("%s", what, sizeof(what));
//Output report contents
printf("\n\n--- criminal information ---\n\n";
printf("name: %s\n", name);
printf("age: %d\n", age);
printf ("Weight: %").1f\n", weight);
printf("key:%.1fl\n", height);
printf("Crime name: %s\n", what);
return 0;
}
I am learning C language through YouTube.
c
printf ("What's your name?"); I think there's a scanf typo at the bottom!
printf ("What's your name?");
scnaf_s("%s", name, sizeof(name));
© 2024 OneMinuteCode. All rights reserved.