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 |
Write a program to implement the motion of a bouncing ball using a downward gravitational force and a ground-plane friction force. Initially the ball is to be projected in to space with a given velocity vector
‎#define good bad main() { int good=1; int bad=0; printf ("good is:%d",good); }
main() { int c[ ]={2.8,3.4,4,6.7,5}; int j,*p=c,*q=c; for(j=0;j<5;j++) { printf(" %d ",*c); ++q; } for(j=0;j<5;j++){ printf(" %d ",*p); ++p; } }
void main() { int i=10, j=2; int *ip= &i, *jp = &j; int k = *ip/*jp; printf(“%d”,k); }
To Write a C program to remove the repeated characters in the entered expression or in entered characters(i.e) removing duplicates. String contains only lowercase characters ['a'-'z']
write a origram swaoing valu without 3rd variable
main ( ) { static char *s[ ] = {“black”, “white”, “yellow”, “violet”}; char **ptr[ ] = {s+3, s+2, s+1, s}, ***p; p = ptr; **++p; printf(“%s”,*--*++p + 3); }
Write out a function that prints out all the permutations of a string. For example, abc would give you abc, acb, bac, bca, cab, cba. You can assume that all the characters will be unique.
5 Answers IITR, Microsoft, Nike,
write a program to count the number the same (letter/character foreg: 's') in a given sentence.
main() { while (strcmp(“some”,”some\0”)) printf(“Strings are not equal\n”); }
int DIM(int array[]) { return sizeof(array)/sizeof(int ); } main() { int arr[10]; printf(“The dimension of the array is %d”, DIM(arr)); }
To Write a C program to remove the repeated characters in the entered expression or in entered characters(i.e) removing duplicates.
19 Answers Amazon, BITS, Microsoft, Syncfusion, Synergy, Vector,