Professional Documents
Culture Documents
INTRINSIC FUNCTIONS
Q4. Without using a computer, find the output the following program;
#include <iostream>
using namespace std;
int main(){
int a(5),b(8);
cout<<"\ta=\t"<<a<<"--->b="<<b
<<"--->\n"<<a+b<<endl;
system ("pause");
}
Q5. Without using a computer, find the output the following program;
#include <iostream>
using namespace std;
int main(){
int a=5;
{
int a=7;
{
int a=12;
cout<<"\t"<<2*a;
}
cout<<"\t"<<2*a;
}
cout<<"\t"<<2*a;
system ("pause");
}
Q6. Correct the program given below that calculates the function for arbitrary values of x.
3
3/2
#include <iostream>
using namespace std; Sample Output
a+ b b a+ b
a) z = b) z = a + c) z = +d
c+d c+d c
a+ b
d) z =
d
c+
e+f
abs(-2.3)/2+1.3*sqrt(4.)/double(5/2)
Q10. Find the result of each line int the following program section:
2
ln
3
where e is well known constant.
Q12. Write a program to obtain the following table for your friends:
Q13. To convert temperatures written in Fahrenheit to Celsius (Centigrade), you subtract 32,
multiply by 5 and then divide by 9. To convert Celsius to Absolute Value (Kelvin), you add
273.15. Write a program that converts a temperature given in Fahrenheit to
Celcius(Centigrade) and Absolute Value(Kelvin).