Question1)
a)
Write a C program that shows the use of mathematical functions to compute
i) absolute value of a real number
ii) exponential of a real number
b) Write C statements which show the use of escape sequences\ n and\?
c) Describe how variables of type int , long int , short int and unsigned int are declared.
d) Which of the following are valid C variables?
i) Count_xyz
ii) Continue
iii) const
iv) case
v) enum_variable
vi) m298773
vii) +signed_Value
viii) _under_bar
Question2)
a) The program given below shows how char and int data types could be used interchangeably.
Find the output of the program.
#include
int
main()
{
char
height=72,width=87,length=76;
int
volume;
printf("The formula for volume is\n");
printf(“%c=%c*%c*%c”,’V’,height,width,length);
volume = height*width*length;
printf(“\nvolume=%d”,volume);
return0;
}
b) Identify the syntax errors in the following statements, if any, and do the essential corrections. (Suppose that x, y, z are declared as int variables.)
i) scan f(“%d,%d”, x,y);
ii) if (x =! y) z = x-y, y = z + x;
iii) print f(“%d,z = ” &z);
iv) x = x + y =< 30;
c) Describe step by step the statement result += (value++ * 5) + ( value++ *3);
d) Describe the output of the following piece of the code
if(!((7>5)*(6<5)))
{printf("Go to your home.");
goto Home;}
else printf("Come,let's study together");
Home: printf(“\n Bye..See you Tomorrow!”);