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

Is main() function predfined or userdefined?

11 Answers  


what is c language?

2 Answers  


regarding the scope of the varibles;identify the incorrect statement: a.automatic variables are automatically initialised to 0 b.static variables are are automatically initialised to 0 c.the address of a register variable is not accessiable d.static variables cannot be initialised with any expression

1 Answers   TCS,


What will be the result of the following C language program? main() { int a = 0; int b = 20; char x = 1; char y = 10; if(a,b,x,y) printf("Welcome"); }

1 Answers  


in multiple branching construct "default" case is a) optional b) compulsarily c) it is not include in this construct d) none of the above

0 Answers  


What are the application of c?

0 Answers  


advantages of pointers?

3 Answers  


When should the const modifier be used?

0 Answers  


Sir i need notes for structure,functions,pointers in c language can you help me please

0 Answers   TCS,


Write a C program in Fibonacci series.

0 Answers   iNautix,


How do you declare a variable that will hold string values?

0 Answers  


please give code for this 1 2 4 7 11 16

11 Answers   Intel, Wipro,


Categories