hi, im having trouble with my project. its a payroll system. i dont know how the name i inputted will be printed correctly. when i use scanf, it just print the first set of words. i learned that i should use strlen() but when i try to use it, it never let me to input then exit the program. what should i do? here's the code:
Code:
#include<stdio.h>
#include<conio.h>
#include<string.h>
#define p printf
#define s scanf
#define g gotoxy
main()
{
int select;
char name[30];
int n;
clrscr();
p("[1] 15th \n[2] Monthly \n\nSelect mode of payment: ");
s("%d", &select);
if(select==1)
{
clrscr();
p("15th \n\n");
p("Enter employee's name: ");
gets(name);
n=strlen(name);
p("Employee's Name: %s", name);
}
else if(select==2)
{
clrscr();
p("Monthly \n\n");
}
else
{
clrscr();
p("Invalid Selection");
}
getch();
}
i need this tomorrow morning so please help me, thank you