C Program is not executing printf at the end

I'm just doing a tiny exercise for school and i'm stuck with the scanf function. 

I'm just doing a tiny exercise for school and i'm stuck with the scanf function. 

If i'm running this code, everything just works fine at the beginning, but as soon as all 5 scanf's are done, it just stops working and exits without printing that printf at the end. Where's the problem on this? 

Now here comes the Code(I code in visual studio 2017 on Windows 10):

#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <stdlib.h>

int main() {
char name[50];
char gender[1];
float wage = 0;
int age = 0;
int height = 0;

printf("\nInput Name: ");
scanf(" %s", name);

printf("\nInput Gender (m/f): ");
scanf(" %c", &amp;gender);

printf("\nInput Monthly Wage: ");
scanf(" %d", &amp;wage);

printf("\nInput Age: ");
scanf(" %d", &amp;age);

printf("\nInput height in cm: ");
scanf(" %d", &amp;height);


printf("\nNAME: %s\nGENDER: %c\nWAGE %d\AGE: %d\nSIZE: %d", name, gender, wage, age, height);

return 0;
getchar();

}


Accelerate your C++ development (with Visual Studio 2019)

Join us for a demo-heavy rundown of all the reasons you should be excited about Visual Studio 2019 for C++ development. Learn about all that is new, from updates to the CMake integration for targeting Windows and Linux, to C++ productivity, performance and build throughput improvements as well as our progress on C++20 conformance.CMake integration for targeting Windows and Linux, to C++ productivity, performance and build throughput improvements as well as our progress on C++20 conformance.

Join us for a demo-heavy rundown of all the reasons you should be excited about Visual Studio 2019 for C++ development. Learn about all that is new, from updates to the CMake integration for targeting Windows and Linux, to C++ productivity, performance and build throughput improvements as well as our progress on C++20 conformance.CMake integration for targeting Windows and Linux, to C++ productivity, performance and build throughput improvements as well as our progress on C++20 conformance.

Learn More

Unreal Engine C++ Developer: Learn C++ and Make Video Games

Learn C++ Programming -Beginner to Advance- Deep Dive in C++

Learn C++ Programming from Beginner to Expert : 2019

Learn OOP C# Programming Techniques and Methods with Object Orientated Programming

VS Code: C++ Development with Visual Studio Code

Bring Some C++ to Xamarin Apps

Create a C# Application from Start to Finish - Complete Course

VS Code: C++ Development with Visual Studio Code

If you’re looking for a fast and lightweight code editor, Visual Studio Code has you covered. Come get an overview of Visual Studio Code along with the C++ extension that enables editing, building, and debugging your C++ code across Windows, Mac, and Linux.



Thanks for reading

If you liked this post, share it with all of your programming buddies!

Follow us on Facebook | Twitter