Looking for Course 31709 test answers and solutions? Browse our comprehensive collection of verified answers for Course 31709 at lms.aub.edu.lb.
Get instant access to accurate answers and detailed explanations for your course questions. Our community-driven platform helps students succeed!
What happens if you forget to free memory allocated with malloc()?
Employee Management System
Write a C program that:
Example Output:
Enter the number of employees: 3
Enter employee 1 name: Alice
Enter employee 1 ID: 101
Enter employee 1 SALARY: 3800
Enter employee 2 name: Bob
Enter employee 2 ID: 102
Enter employee 2 SALARY: 3500
Enter employee 3 name: Charlie
Enter employee 3 ID: 103
Enter employee 3 SALARY: 3900
Employee Records:
Alice (ID: 101, SALARY: 3800)
Bob (ID: 102, SALARY: 3500)
Charlie (ID: 103, SALARY: 3900)
Top Employee: Charlie (ID: 103, SALARY: 3900)
#include "stdio.h"
int main()
{
struct {int a[2];} arr[] = {{1},{2}};
printf("%d %d %d %d",arr[0].a[0],arr[0].a[1],arr[1].a[0],arr[1].a[1]);
return 0;
}
Pick the best statement for the program above:
What header file is needed to use malloc() and free()?
We use malloc and calloc for
Which of the following operators can be applied on structure variables?
What is the return type of malloc() or calloc()