It should not be capable of free action because there's no telling if it would be friendly for good remarks or mean for rude remarks
Answer:
Following are the program in the Python Programming Language.
#get input from the user
x = float(input())
#get input from the user
y = float(input())
#get input from the user
z = float(input())
#find the average
average =(x+y+z)/3
#find the product
product = x*y*z
#print the result in given format
print('\n%d %d'%(average,product))
#print the result in given format
print('%0.2f %0.2f'%(average,product))
Explanation:
<u>Following are the description of the program</u>:
- We set three variables 'x', 'y', and 'z' that accept float type values from the user.
- Then, set variable 'average' that store the average of the following values that is given by the user.
- Set variable 'product' that store the multiplication of the following values that is given by the user.
- Finally, we print the average and the product in the following format that is given in the statement.
Complete Question:
Recall that with the CSMA/CD protocol, the adapter waits K. 512 bit times after a collision, where K is drawn randomly. a. For first collision, if K=100, how long does the adapter wait until sensing the channel again for a 1 Mbps broadcast channel? For a 10 Mbps broadcast channel?
Answer:
a) 51.2 msec. b) 5.12 msec
Explanation:
If K=100, the time that the adapter must wait until sensing a channel after detecting a first collision, is given by the following expression:
The bit time, is just the inverse of the channel bandwidh, expressed in bits per second, so for the two instances posed by the question, we have:
a) BW = 1 Mbps = 10⁶ bps
⇒ Tw = 100*512*(1/10⁶) bps = 51.2*10⁻³ sec. = 51.2 msec
b) BW = 10 Mbps = 10⁷ bps
⇒ Tw = 100*512*(1/10⁷) bps = 5.12*10⁻³ sec. = 5.12 msec
Answer:
I get 0x55 and this the linking address of the main function.
use this function to see changes:
/* bar6.c */
#include <stdio.h>
char main1;
void p2()
{
printf("0x%X\n", main1);
}
Output is probably 0x0
you can use your original bar6.c with updaated foo.c
char main;
int main() // error because main is already declared
{
p2();
//printf("Main address is 0x%x\n",main);
return 0;
}
Will give u an error
again
int main()
{
char ch = main;
p2(); //some value
printf("Main address is 0x%x\n",main); //some 8 digit number not what printed in p2()
printf("Char value is 0x%x\n",ch); //last two digit of previous line output
return 0;
}
So the pain in P2() gets the linking address of the main function and it is different from address of the function main.
Now char main (uninitialized) in another compilation unit fools the compiler by memory-mapping a function pointer on a char directly, without any conversion: that's undefined behavior. Try char main=12; you'll get a multiply defined symbol main...
Explanation: