I am trying to create a program where the user enters their name and a float number, when the user enters their name it completely skips the part to enter a double I am not sure what is causing this problem the code bellow is what i have:
#include <stdio.h>
#include <stdint.h>
//extern double control(); //name in asm label (ex. global start)
int main()
{
char name[100];
double salary;
printf("Welcome to Software Analysis by Paramount Programmers, Inc.\n");
printf("Please enter your first and last name and press enter: ");
scanf("%s", name);
scanf("%lf", &salary);
printf("%lf", salary);
//printf("%f", var);
return 0;
result
Welcome to Software Analysis by Paramount Programmers, Inc.
Please enter your first and last name and press enter: david n
0.000000The bash script file will terminate