I have been trying to create a basic input program but the compiler skips the second input
It just skips the pay and hour input and assign it 0 as value
Please refer to line 12 and 13
#include <stdio.h>
void main()
{
char emp_id[10];
printf("Please enter your employee id >> n");
scanf("%c", emp_id);
int hours, pay;
printf("Please enter total working hours and pay >> n");
scanf("%d,%d", hours, pay);
printf("Total salary >> %d", pay*hours );
}
I was trying to get a prompt for pay and hour but it automatically assigned them 0 as value .
I tried to take the inputs separately but that also didnt work.
New contributor
Metereya Rawat is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
14