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);
}

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

Write a function which takes as parameters one regular expression(only ? and * are the special characters) and a string and returns whether the string matched the regular expression.

641


Explain what is #line used for?

599


What is pointers in c with example?

571


What is a newline escape sequence?

658


What are dangling pointers in c?

629






What is the explanation for the dangling pointer in c?

666


How can I access an I o board directly?

614


How do you convert strings to numbers in C?

699


What are the benefits of organizational structure?

562


How does free() know explain how much memory to release?

610


What is union in c?

624


how is the examination pattern?

1587


Explain how can you check to see whether a symbol is defined?

649


What is c++ used for today?

650


Explain the difference between ++u and u++?

631