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

char S; char S[6]= " HELLO"; printf("%s ",S[6]); output of the above program ? (0, ASCII 0, I,unpredictable)

7 Answers   Mascot,


What is 2c dna?

0 Answers  


in C-programming language without using printf statement can we get output r not ? if yes how and if no also how ?

11 Answers   IBM,


how to find the binary of a number?

10 Answers   Infosys,


What are all different types of pointers in c?

0 Answers  






enum { SUNDAY, MONDAY, TUESDAY, }day; main() { day =20; printf("%d",); getch(); } what will be the output of the above program

1 Answers  


simple program for virtual function?

1 Answers  


C program to perform stack operation using singly linked list

3 Answers  


void main() { int i=5; printf("%d",i+++++i); }

17 Answers   ME,


What are the application of c?

0 Answers  


how to use virual function in real time example

1 Answers   CTS, Wipro,


how to reverse string "Hello World" by using pointers only. Without any temp var

1 Answers  


Categories