SOLUTION: 2. Indicate which of the following are valid type int , double , or char constants in C and which are not. Identify the data type of each valid constant. 'PQR' 15E-2 35 'h'

Algebra ->  Decimal-numbers -> SOLUTION: 2. Indicate which of the following are valid type int , double , or char constants in C and which are not. Identify the data type of each valid constant. 'PQR' 15E-2 35 'h'       Log On


   



Question 1095454: 2. Indicate which of the following are valid type int , double , or char constants in C and which are not. Identify the data type of each valid constant.
'PQR' 15E-2 35 'h' -37.491 .912 4,719 'true' "T" 4.5e3 '$'
3. What would be the best variable type for the area of a circle in square inches? Which type for the number of cars passing through an intersection in an hour? The first letter of your last name?
4. Show the output displayed by the following program lines when the data entered are 5 and 7:
printf("Enter two integers> ");
scanf("%d%d", &m, &n);
m = m + 5;
n = 3 * n;
printf("m = %d\nn = %d\n", m, n);
5. Show the output displayed by the following lines if the value of exp is 11 :
printf("My name is "); printf("Abrar Hossain."); printf("\n");
printf("I live in ");
printf("Dhaka, BD\n");
printf("and I have %d years ", exp);
printf("of programming experience.\n");
6. How could you modify the code in Exercise 5 so that “My name is Abrar Hossain.”
and “I live in Dhaka, BD” would appear on the same line without running together (i.e., with a space between the period and the “I”)?
7. Write a C program that asks the user to enter the radius of a circle and then computes and displays the circle’s area. Use the formula
Area = PI x Radius x Radius
where PI is the constant macro 3.14159.
8. Write a program that stores the values 'X' and 76.1 in separate memory cells. Your program should get the values as data items and display them again for the user when done.
9. What will be the ouput? printf("%d\t",sizeof(6.5)); printf("%d\t",sizeof(90000)); printf("%d",sizeof('A'));

Answer by ikleyn(52781) About Me  (Show Source):
You can put this solution on YOUR website!
.
This forum is for help in algebra.


Not in programming.


Try to find another, more appropriate site.