An expression that is either true or false is a(n) a condition b variable c relational d none Which one of these is not the name of a C library function? a printf b squareroot c void d scanf Answer all questions What is a compiler? What would be displayed by the following program? int main(void) { double a, b: a = 37.56: b = 101.117: printf(“Is it %. 1f %.4fn”, a, b): return (0): } What data types would you use to represent the following items: (i) number of children at school (ii) a letter grade on an exam (iii) the average number of school days a child is absent each year Rewrite the following mathematical expressions in ‘C’ using math library functions: (i) b^2 – 4ac (ii) Squareroot (u – v) What is illegal about the following program fragment? #include # define P1 3.14 int main(void) { double circum, r: scanf(“%1f%1f”, circum. r): PI = circum/(2* r): }
Expert Answer
9. a) condition is a statement that can turn out to be true or false.
10. c) void – Void is not a function it is a keyword which means empty or nothing.
1. A compiler a program that converts any high level language / medium level language to machine code so that computer understands it and run the instructions depicted by machine code.
2. The output is Is it 37.560000 101.1170 , %.4f tells the compiler to print first 4 decimal places and lf prints standard double length with 6 digits after decimal
3.
i) int
ii) char
iii) double
4.
i) pow(b,2) – 4*a*c
ii) sqrt (u-v)
5.
The issue is with line
PI = circum/(2*r)
PI is a constant defined and its value cannot be changed..