Computer problems,Computer help
*AX SOFT>>>Programming & Design

Very simple math help in C programming?


3. What will be the value of the following variables after running the following statements through the compiler?
i) iValue1= (((2*3)-((6-3)%2))+(2+5/2));
ii) iValue2= 5/(4-2)+9/4-1;
iii) iValue3 = 3 * (5%3) ;

4. Determine the order of execution of operations in the code below. Determine the sequence actively.

9 3 6
answers are:
ivalue1=9
ivalue2=3
ivalue3=6

so first i start from ivalue3,ie easy
c compiler precedence
first give preference to brackets
iValue3 = 3 * (5%3) ;
so first 5%3,it takes remainder=2,then 3*2=6,finally answer=6

second:iValue2= 5/(4-2)+9/4-1;
first it takes brackets,
5/2+9/4-1 then
2+9/4-1
2+9/3
11/3
3
finally answer is 3

first one:
iValue1= (((2*3)-((6-3)%2))+(2+5/2));
(((6)-(3%2))+(2+2))
( ( (6)-(1) ) + (4))
((5)+(4))
so,finally the value is 9.

cout << "hello world";

#include <iostream>

int main(void) {
std::cout << "Do your own homework." << std::endl;

return 0;
}

3. The variables won't have any value after you run through the compiler. They don't even exist until the program runs. However, since all of the values are constants, the compiler will create code that initializes the variables to the results of the equations so that won't have to happen at runtime. But the actual answer to the question is that the variables don't exist until the program runs. When the program is just sitting there after having been compiled the variables don't even exist.

(In other words, this is a dumbly worded question.)

4. There is no code below.

cout << "May be you can contact a homework helper at website like http://homeworkhelp.co.in/ " << endl;

Tags
  General - Computers & Internet   Software   Security   Programming & Design   Facebook   Flickr   Google   MSN   MySpace
Related information
  • Can somebody give me the names of other video uploading sites...?

    Hi, now a days most of the social networking websites come with a video upload facility. I could name a few: rediff ishare hi5 google...there are lots...just browse it or google it!..u would f...

  • Java menu Hell... Please help!!!! 10 PTS TO THE FIRST ANSWER THAT WORKS?

    hi You send me the files you want to update and i will update it for you Regards Asim

    ...
  • Java help! Do while boolean is false loop?

    import java.util.Scanner; public class ans1 { public static void main (String [] args) { Boolean good = false; Scanner keyboard = new Scanner(System.in); Double a; Stri...

  • HTML and Javascript Program?

    <script type="text/javascript"> function leng() { var str=document.form1.getinput.value; alert("length of String : " +str.length); } </script> <form name...

  • I need a logo for my Construction firm?

    Why don't you search existing logo sites to get ideas? Here are some to try - Logo Search - ...

  • How do you make this into an animated gif?

    i got the flash file from ...

  • I.E. 7 View Problem?

    Use Mozilla Firefox bro!

    ...
  • Web Design Languages?

    It's always good to know as many languages as possible. Of course you won't have the time to master everyone, but you don't need to - that would be time prohibitive. PHP is a good...

  •  

    Categories--Copyright/IP Policy--Contact Webmaster