Answer:
long power(int i)
{
return pow(2,i);
}
Explanation:
The above written function is in C++.It does not uses loop.It's return type is long.It uses the function pow that is present in the math library of the c++.It takes two arguments return the result as first argument raised to the power of second.
for ex:-
pow(3,2);
It means 3^2 and it will return 9.
Answer:
B. is easier to write programs
Explanation:
High-level languages are most commonly used languages these days. The ease of understanding and writing programs in high-level language has made them very popular. High-level languages are near to human. English words are used to write programs in these languages. So option B is the correct answer..
Answer:
Two systems are connected by a router. Both systems and the router have transmission rates of 1,000bps. Each link has a propagation delay of 10ms. Also, it takes router 2ms in order to process the packet (e.g. decide where to forward it). Suppose the first system wants to send a 10,000 bit packet to the second system. How long will it take before receiver system receives the entire packet.
Transmission time for first Router = 10,000 bits / 1000 bps = 10 seconds
Receiving time for seond route r= 10,000 bits / 1000 bps = 10 seconds
Propagation delay = 10ms = .01 seconds x 2 for two delays = .02 seconds
First router 2ms to process = .002 seconds
Add all the times together and we get 20.022 seconds which is the same as or 20 seconds and 22 ms
Answer:
The trigger code is given below
create trigger F1_Del
after delete on Friend
for each row
when exists (select * from Friend
where ID1 = Old.ID2 and ID2 = Old.ID1)
begin
delete from Friend
where (ID1 = Old.ID2 and ID2 = Old.ID1);
end
create trigger F1_Insert
after insert on Friend
for each row
when not exists (select * from Friend
where ID1 = New.ID2 and ID2 = New.ID1)
begin
insert into Friend values (New.ID2, New.ID1);
end
Answer:
if(x>12 || x<34)
Explanation:
Mashing the two together using the or '||' operator would allow to run both necessary functions for the next code.