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 / 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 |
I didn't count the ducks that I saw in line, but I do remember that one duck was in front of two ducks, another duck behind two ducks. How many ducks did I see?
Is null a keyword in c?
Explain the difference between getch() and getche() in c?
Is null valid for pointers to functions?
get any number as input except 1 and the output will be 1.without using operators,expressions,array,structure.don't print 1 in printf statement
how to use virual function in real time example
1.what are local and global variables? 2.what is the scope of static variables? 3.what is the difference between static and global variables? 4.what are volatile variables? 5.what is the use of 'auto' keyword? 6.how do we make a global variable accessible across files? Explain the extern keyword? 7.what is a function prototype? 8.what does keyword 'extern' mean in a function declaration?
Write a program which returns the first non repetitive character in the string?
main() { int i=0; while(+(+i--)!=0) i-=i++; printf(i); }
WRITE A PROGRAM TO FIND A REVERSE OF TWO NO
write a c program to find the sum of five entered numbers using an array named number
What is a far pointer?What is the utility?