write a c program to Create employee record by taking
details like name, employee id, address and phone number.
While taking the phone number, take either landline or
mobile number. Ensure that the phone numbers of the employee
are unique. Also display all the details
Answers were Sorted based on User's Feedback
Answer / puneet mittal
#include<stdio.h>
#include<conio.h>
#include<string.h>
main()
{
struct Employee
{
char name[20];
int id;
char address[50];
int phno;
};
struct Employee emp[10];
int i,j;
printf("EMPLOYEES RECORD : \n\n");
for(i=0;i<2;i++)
{
printf("\n");
printf("Enter detail of Employee %d\n
",i+1);
printf("Employee name : ");
scanf("&s",&emp[i].name);
printf("Employee id no.: ");
scanf("%d",&emp[i].id);
printf("Address:");
scanf("%s",&emp[i].address);
printf("Phone number(give either
landline or mobile number):");
pass:
scanf("%d",&emp[i].phno);
if(i>0)
{
for(j=0;j<2;j++)
{
if(emp[j].phno==emp[i].phno)
{
printf("this phone number is having
employee id no. - %d ",emp[j].id);
printf("TRY AGAIN . ");
goto pass;
}
}
}
}
getch();
}
Is This Answer Correct ? | 9 Yes | 9 No |
Answer / vinesh2009sharma
void main()
{
printf("enter the EMP NAME EMP ID ..........")
sca
Is This Answer Correct ? | 3 Yes | 10 No |
hello sir,is there any function in C that can calculate number of digits in an int type variable,suppose:int a=123; 3 digits in a.what ll b answer?
source code for delete data in array for c
void main() { static int i; while(i<=10) (i>2)?i++:i--; printf(ā%dā, i); }
Write a routine that prints out a 2-D array in spiral order
#include <stdio.h> int main(void) { int a=4, b=2; a=b<<a+b>>2 ; printf("%d",a); return 0; }
main() { int i=300; char *ptr = &i; *++ptr=2; printf("%d",i); }
main() { int i=5,j=10; i=i&=j&&10; printf("%d %d",i,j); }
How to palindrom string in c language?
how to print 1 2 3 4 5 6 7 8 9 10 9 8 7 6 5 4 3 2 1 using any loop(for or while) only once(only 1 loop) and maximum 2 variables using C.
19 Answers Cap Gemini, Infosys,
main() { int a=10,*j; void *k; j=k=&a; j++; k++; printf("\n %u %u ",j,k); }
write a program in c language to get the value of arroy keys pressed and display the message which arrow key is pressed?
main() { char i=0; for(;i>=0;i++) ; printf("%d\n",i); }