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 |
in ‘C’ language for Matrix Multiplication fails” Introspect the causes for its failure and write down the possible reasons for its failure.
What are macros in C?
which will return integer? a) int*s ( ) b) ( int* ) s( ) c) int ( *s ) ( )
Hai,I have done with my bachelor of commerce and planing to ms,please suggest me how to convince vo for shifting from commerce to computers. Visa on 8 DEC 2014 Npu university
There seem to be a few missing operators ..
is compiler do read the data line by line or not. ??
6 Answers LG Soft, Satyam, Tech Mahindra,
Write a program using bitwise operators to invert even bits of a given number.
Write a program to find whether the given number is prime or not?
in malloc and calloc which one is fast and why?
WHICH TYPE OF JOBS WE GET BY WRITING GROUPS .WHEN THE EXAMS CONDUCTED IS THIS EXAMS ARE CONDUCTED EVERY YEAR OR NOT.PLS TELL ME THE ANSWER
Which of the following is not an infinite loop ? a.while(1){ .... } b.for(;;){ ... } c.x=0; do{ /*x unaltered within theloop*/ ... }while(x==0); d.# define TRUE 0 ... while(TRUE){ .... }
Does sprintf put null character?