So I wrote this program that asks for your details. The part where it asks for details works , but then it fails to show the details in the last bit of the program.
It crashes .. why ?
Code:
#include <stdio.h>
#include <ctype.h>
int main() {
char name = '\0';
char surname = '\0';
int passport=0;
printf("Enter name: ");
scanf("%s", &name);
printf("Enter surname ");
scanf("%s", &surname);
printf("Enter passport: ");
scanf("%d", &passport);
printf("Your details are: name:%s , surname:%s , passport:%d", name,surname,passport);
}