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.Com
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)   (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.



RELATED QUESTIONS

Is the answer CD - invalid? If not, what is it and why? Thanks! Determine whether the... (answered by jim_thompson5910)
Consider the following statements X: All policemen wear uniform; Y: Civil servants do... (answered by CPhill)
Please Help. I'm so confused and lost with theese questions. 1. Write a negation of... (answered by amyd62)
1. Write a negation of the statement. All squares are parallelograms.... (answered by nyc_function)
Which equation is valid for all ordered pairs shown in this table. the x side of the... (answered by stanbon)
Which of the following is not a conic section? a. Circle b. Hyperbola c. | x | d.... (answered by nabla)
The distance, in feet, that a certain object travels after t seconds is given by the... (answered by ikleyn)
I've compared them to every rule and they don't make sense to me. INSTRUCTIONS:... (answered by solver91311)
please help me with this question, Populations whose growth is limited can often be... (answered by ikleyn)