Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main(void){
- //
- // declare and intialize working storage
- //
- int marks;
- //
- //prompt for grade
- //
- printf("Enter your marks :");
- scanf("&d", &marks);
- if(marks <= 100 && marks >=90){
- printf("You got an A");
- }
- else if(marks <= 89 && marks >=80){
- printf("You got a B");
- }
- else if(marks <= 79 && marks >=70){
- printf("You got a C");
- }
- else if(marks <= 69 && marks >= 50){
- printf("You got a D");
- }
- else{
- printf("error");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement