Answer:
The golang control flow statements are used to break the flow of execution by branching, looping, decision making statements by enabling the program to execute code based on the conditions. All programmers must know the control flows like if-else, switch case, for loop, break, continue, return.
Explanation:
Card
......... ......... ........
Answer:
The first automatic digital computer has been designed by the English mathematician and inventor Charles Babbage. Babbage developed the Analytical Engine Plans for the mid-1830s.
Explanation:
- Babbage has developed the concept of a digital, programmable computer and was a mathematician, philosopher, inventor, and mechanical engineer.
-
Some regard Babbage as a "computer father"
-
The inventing of its first mechanical computer, the difference engine, is attributable to Babbage, which eventually resulted in more complex electronic designs, although Babbage's Analytical Engine is the main source of ideas for modern computers. He was described as the "prime" among the numerous polymaths of his century by his varied work in another field.
Answer:
The function in C++ is as follows:
int isSorted(int ar[], int n){
if ( || ){
return 1;}
if ( < ){
return 0;}
return isSorted(ar, n - 1);}
Explanation:
This defines the function
int isSorted(int ar[], int n){
This represents the base case; n = 1 or 0 will return 1 (i.e. the array is sorted)
if ( || ){
return 1;}
This checks if the current element is less than the previous array element; If yes, the array is not sorted
if ( < ){
return 0;}
This calls the function, recursively
return isSorted(ar, n - 1);
}
Multiple inheritance causes Diamond problem which happens when:
Class A is parent of class B and C
Now when class D will be inherited from both Class B and C it will have all the members of class A and B which if same will confuse the compiler to import which one?
C++ solves it by using virtual keyword with them and thus telling the compiler which one to inherit.
Java has introduced the interface concept rather then allowing multiple inheritance.