(Completed) Fundamentals of Programming Assingment
(Completed) Fundamentals of Programming Assingment
Assignment 01
Department of Computer Science
Explanation:
The code is simply asking us to compare 1 and i, In this case, i has been assigned value of 1
too. Therefore, we get output 1, which means the statement is true.
b: Code & Output (Statement 2):
Explanation:
Here were using the && operator, which means its a Logical AND operator. This requires both
statement p & q to be true. But since k < m is incorrect, the output is 0.
e: Code & Output (Statement 5):
Explanation:
In this statement we are using ||, or Logical OR operator. If, out of the given two statements,
even one of them is true, the program would give output of 1.
Explanation:
In this case were using !, or Logical NOT operator. What this does is, it basically reverses the
value of any given statement. For example, if we have 1 as value, itll become 0.
Explanation:
A simple programs that takes Radius as user input & returns value of Circumference, Area, and
Diameter.
Question No. 3:
Code:
Output:
Explanation:
A simple program that takes user input in the form of various values such as mileage, tax, tolls,
e.t.c. and returns value of user cost per day.
Question No. 4:
Code:
Output:
Explanation:
A simple programs that calculates the total sum of students Quizzes, Mid-Term & Finals results.
Question No. 5:
Code:
Output:
return 0;