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
What are bitwise shift operators in c programming?
how to build a exercise findig min number of e heap with list imlemented?
What is a memory leak? How to avoid it?
With the help of using classes, write a program to add two numbers.
What is the difference between exit() and _exit() function in c?
Why flag is used in c?
what are bit fields in c?
what are enumerations in C
Define Spanning-Tree Protocol (STP)
void main(){ int a; a=1; while(a-->=1) while(a-->=0); printf("%d",a); }
What is the process to generate random numbers in c programming language?
Write a C/C++ program that connects to a MySQL server and checks if the InnoDB plug-in is installed on it. If so, your program should print the maximum number of concurrent threads that the InnoDB plug-in can create.
What is a pointer in c?
How to write a program for machine which is connected with server for that server automatically wants to catch the time for user of that machine?
Explain the use of fflush() function?