Create a C program that will accept student name, prelim grade, midterm grade and final grade then compute and display for cumulative grade based on the formula: CG=15% of prelim + 30% midterm + 55% final. Your program should display the output based on the following sample run.
Sample Run:
Enter student name:
Prelim grade:
Midterm grade:
Final grade:
Cumulative grade:
Declare integer variables x, y, z and assign the value 10 in the y and 20 in the z.
Create three structures using linked list: Student, University & Branch.
Student structure contains Name, Roll No & Branch ID [in which the student studies], University structure contains University ID & University Name) &
Branch structure contains Branch ID & Branch Name
Implement the following function to :-
Develop a stack using C program to check whether the given expression [a+[b+(c+d)]} is balanced or not
What is the output of the following program?
int main() {
char arr[11]="Engineering Programming 2 (EIENP2A)";
printf("%s",arr);
return 0;
Choose the c methods applicable for reading to a text file from the items given below:
(a) get ()
(b) close ()
(c) getw()
(d) fread()
fill in the missing:
Assume the following program snippet writes to text file:
int main() {
FILE * ptr;
int num;
_____________________= fopen("d:\\writingTo_File.txt", "");_________________
if (ptr !=___________________) {
printf("File created successfully!\n");
}
else {
printf("Failed to create the file.\n");
// exit status that an error occurred
return -1;
}#include <stdio.h>
int main() {
FILE * fp;
fp = fopen ("d:\\music.txt", "w");
fprintf (fp ,"Engineering Programming");
fclose(____________);
return______________;
}Assume the following piece of code reads from a text file
int main() {
int sum =0;
FILE * ptr;
ptr = fopen("d:\\students.________","___________");
if (ptr ==NULL){
_______________("file does not exist!!");
exit(0);
}A shop had N number of sales each day for M days. Each day different types of items were sold and had different profits associated with them, but the quantity of items sold each day was the same. The owner of the shop wishes to know the minimum profit made each day. For this, a structure was formed in which profit for all different items for an individual day was kept in the same column for M days.
Write an algorithm to find the minimum profit for each day individually.
Input
The first line of the input con beats of
Given an array container and integer hunt. WAP to find whether hunt is present in container or not. If present, then triple the value of hunt and search again. Repeat these steps until hunt is not found. Finally return the value of hunt.
Input: container = {1, 2, 3} and hunt = 1 then Output: 9
Explanation: Start with hunt = 1. Since it is present in array, it becomes 3. Now 3 is present in array and hence hunt becomes 9. Since 9 is a not present, program return 9.