Question

Programming Question 1 Write a C program that takes students marks from a user, one by one until -1 is entered, which would

using C language

0 0
Add a comment Improve this question Transcribed image text
Answer #1

//Find Attached SS of Code and Output

#include <stdio.h>
int main()
{
float marks;
printf("Enter Student's Marks and Write -1 for Exit");
printf("\n");
//to get marks before entering in loop
scanf("%f", &marks);
//This will run until -2 is entered and it will keeping checking the if else conditions
while(marks!=-1){
if (marks < 60){
printf("Fail");
}
else if (marks > 60 && marks <= 70){
printf("D");
}
else if (marks > 70 && marks <= 80){
printf("C");
}
else if (marks > 80 && marks <= 90){
printf("B");
}
else if (marks > 90 && marks <= 100){
printf("A");
}
printf("\n");
//to take input of marks in loop
scanf("%f",&marks);
}
return 0;
}
mt no 000 1 #include <stdio.h> 2 int main() { float marks; printf(Enter Students Marks and Write -1 for Exit); printf(\nEnter Students Marks and Write -1 for Exit 89 B - 90 100 56 Fail ... Program finished with exit code 0 Press ENTER to exit c

Add a comment
Know the answer?
Add Answer to:
using C language Programming Question 1 Write a C program that takes students marks from a...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • please use the c language Assignment 12 The program to write in this assignment is a...

    please use the c language Assignment 12 The program to write in this assignment is a program that calculates score statistics and manages the grades of the students. First, the student list and are given in a file named "student.dat" as in the following: 이성우 77 홍길동 88 scores 201 1710086 2012700091 This program reads the input file "student.dat" and keeps this data in a linear linked list. Each node must be a struct which contains the following: student id...

  • codeblock c++ language Write a program that reads students test scores in the range 0-200 from...

    codeblock c++ language Write a program that reads students test scores in the range 0-200 from a file until end of file (use e of() to check if ifstream reaches the End of File Stream) and store those scores in an array. It should then determine the number of students having scores in each of the following ranges: 0-24, 25-49, 50-74, 75-99, 100- 124, 125–149, 150-174, and 175–200. Finally, the program outputs the total number of students, each score range...

  • C++ The programming language is c++ our program using the following data Mary Smith Green walley...

    C++ The programming language is c++ our program using the following data Mary Smith Green walley Thul Bool Gauteng ) Please key is the n ot your Ter in your mark for Mathematics Ey in your mark for use orientation Key in your mark for watory Wer in your work for Computer literacy Te in r for at e Jobs Africa School: King College 9/11 - Average Year Wark53.67 with label and code The T a QUESTION 2: (40) Suppose...

  • C++ Write a program that reads the number of students in the class, then reads each...

    C++ Write a program that reads the number of students in the class, then reads each student's name and his/her test score. Print out each student name, test score and grade, and the average score of the whole class. The program must use vectors and loops for the implementation. The grades are determined as follows: A >= 90; 80 <= B < 90; 70 <= C < 80; 60 <= D < 70; F < 60.

  • Java Program: In this project, you will write a program called GradeCalculator that will calculate the...

    Java Program: In this project, you will write a program called GradeCalculator that will calculate the grading statistics of a desired number of students. Your program should start out by prompting the user to enter the number of students in the classroom and the number of exam scores. Your program then prompts for each student’s name and the scores for each exam. The exam scores should be entered as a sequence of numbers separated by blank space. Your program will...

  • Kindly solve this using C PROGRAMMING ONLY. 4. Write a program marks.c which consists of a...

    Kindly solve this using C PROGRAMMING ONLY. 4. Write a program marks.c which consists of a main function and three other functions called. readmarks , changemarks (, and writemarks() The program begins by calling the function readmarks () to read the input file marksin. txt which consists of a series of lines containing a student ID number (an integer) and a numeric mark (a float). Once the ID numbers and marks have been read into arrays (by readmarks () the...

  • Write down a Cre program on computer that calculates the grades of the stud f the...

    Write down a Cre program on computer that calculates the grades of the stud f the students for the marks by using "if else statements "for the following conditions. Marks 60 Grade "D" Marks > 60 &&70 Grade "C" Marks > 70 &&80 Grade "B" Marks > 80 && 90 Grade "A" Marks> 90 && -100 Grade "A+"

  • Using the C programming language, write a program that takes in hexadecimal characters (using the fgets()...

    Using the C programming language, write a program that takes in hexadecimal characters (using the fgets() function) and return a translated string of ASCII characters. Use only BITWISE operators, not arithmetic.

  • Write a program in Java according to the following specifications: The program reads a text file...

    Write a program in Java according to the following specifications: The program reads a text file with student records (first name, last name and grade on each line). Then it prompts the user to enter a command, executes the command and loops. The commands are the following: "print" - prints the student records (first name, last name, grade). "sortfirst" - sorts the student records by first name. "sortlast" - sorts the student records by last name. "sortgrade" - sorts the...

  • Lab-3C   Pre-test Loop Write a MIPS program to count the number of students who failed in...

    Lab-3C   Pre-test Loop Write a MIPS program to count the number of students who failed in a course. The final grades are given in an array. The fail grade is 60. Example: Array and Output      .data NoOfStudents: 10 Values:   60 70 80 50 90 80 55 90 80 70 Output: 2 students failed      .data NoOfStudents: 12 Values:   60 70 80 50 90 80 55 90 80 70 55 80 Output: 3 students failed

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT