Ask Question
22 June, 17:02

Assume that the variables gpa, deansList and studentName, have been declared and initialized. Write a statement that adds 1 to deansList and prints studentName to standard out if gpa exceeds 3.5.

+1
Answers (1)
  1. 22 June, 18:36
    0
    Following are the code in c language

    #include / / header file

    int main () / / main function

    {

    float gpa=4.5; / / assuming variable

    int deansList=8;

    char studentName[45]="patel";

    if (gpa > 3.5) / / checking condition gpa exceeds 3.5.

    {

    deansList++; / / add 1 to deanslist

    printf ("%s", studentName); / / prints student name

    }

    return 0;

    }

    Explanation:

    In this program we declared and initialized variables "gpa" with 3 of type "float", "deansList" with 8 of type "int" and "studentName" with "Patel" of type "char array". after that we check the condition if "gpa" exceed 3.5, then the block of if is executed and it increment the value of "deansList" by 1 and print the studentName.

    output

    patel
Know the Answer?
Not Sure About the Answer?
Find an answer to your question ✅ “Assume that the variables gpa, deansList and studentName, have been declared and initialized. Write a statement that adds 1 to deansList ...” in 📘 Computers and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers