2.Given the short c program that follows
a. make a list of the memory variables in this program
b.which lines of code contain operations that change the
contents of memory? what are those operations?
Void main( void)
{
Double base;
Double height;
Double area;
Printf(“enter base and height of triangle :”);
Scanf(“%lg”, &base);
Scanf(“%lg”, &height);
Area=base*height/2.0;
Printf(“the area of the triangle is %g \n”,area);
}



2.Given the short c program that follows a. make a list of the memory variables in this program ..

Answer / abdur rab

1 void main( void)
2{
3 double base;
4 double height;
5 double area;
6 printf("enter base and height of triangle :");
7 scanf("%lg", &base);
8 scanf("%lg", &height);
9 area=base*height/2.0;
10 printf("the area of the triangle is %g \n",area);
11}

Answer for a.
3 double base;
4 double height;
5 double area;

Answer for b.
7 scanf("%lg", &base);
8 scanf("%lg", &height);
9 area=base*height/2.0;

Operations
-----------
The scanf() function scans input from the file designated
by stdin under control of the argument format. The format
string here is %lg to get double. Following the format
string is the list of addresses of items to receive values.

and and assignment operation

Is This Answer Correct ?    3 Yes 0 No

Post New Answer

More C Interview Questions

What is the importance of c in your views?

0 Answers  


What is the sizeof () a pointer?

0 Answers  


What is the purpose of 'register' keyword in c language?

0 Answers  


What is the difference between fread and fwrite function?

0 Answers  


What is a stream water?

0 Answers  






What is getch?

0 Answers  


what is the answer for it main() { int i; clrscr(); printf("%d",&i)+1; scanf("%d",i)-1; }

3 Answers  


for(;;) printf("C language") What is out put of above??

2 Answers   Practical Viva Questions,


what is the use of call back function in c?tell me with example

2 Answers   Bosch,


Explain how do I determine whether a character is numeric, alphabetic, and so on?

0 Answers  


What is define c?

0 Answers  


What is file in c preprocessor?

0 Answers  


Categories