TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Hamied Amr
NA
29
2.4k
i have problem on my code
Mar 3 2017 3:52 PM
hey guys when i try to run that code the statement scanf("%c",&checker) the compiler skip it
#include<stdio.h>
#include<string.h>
#include<conio.h>
int main(void){
char emp_first_name[10][10];
char emp_second_name[10][10];
char emp_name[10][50];
int days[10];
int years[10];
int months[10];
float salaries[10];
int i = 0;
char checker;
do
{
printf("Please enter employee first name\n");
scanf("%s",emp_first_name[i]);
printf("Please enter emplyee second name\n");
scanf("%s",emp_second_name[i]);
strcpy(emp_name[i],emp_first_name[i]);
strcat(emp_name[i]," ");
strcat(emp_name[i],emp_second_name[i]);
printf("Do u want to add another one press y if not press n\n");
scanf("%c",&checker);
i++;
} while (checker == 'y');
for (int j = 0; j < 10; j++)
{
printf("%s\n",emp_name[j]);
}
//
scanf("%c",&checker);
return 0;
}
Reply
Answers (
1
)
how to get input
Pre-Requisites to vc++ application that created in VS 2013