A school teacher injured his back and had to wear a plaster cast around the upper part of his body. He wore it under his shirt and it was not noticeable at all. On the first day of the term, still with the cast under his shirt, he found himself assigned to the toughest class in the school.
Walking confidently into the rowdy classroom, he opened the window as wide as possible and then busied himself with desk work. The classroom became a bit unruly and he admonished them. This happened several times.
While working at his desk, the strong breeze from the window made his tie flap annoyingly. He kept rearranging and rearranging the tie as the class become more and more unmanageable.
Finally, becoming disgusted with the wayward tie, he stood up and took a big stapler off his desk and stapled the tie to his chest in several places.
Discipline was not a problem from that day forth.
How can you make a horse game?
all you have to do is go to google and type in make your own horse game
Program to convert binary to decimal without using array?
Suppose your binary number is stored in a series of bits in the unsigned long type named bits.
Then the fragment of a C program to convert this number to a decimal value would be ..
double decimal_value = 0.0;
for ( unsigned long i = 0; i < sizeof(unsigned long); ++i)
{
decimal_value += pow(2,i) * ( bits & 1 );
bits >> 1; // shift all the bits to the right one spot.
} // end for i
Doing this work is generally unnecessary as functions such as these are built in to most programing languages.
Another method for this: double decimal_value= bits;
Prove by mathematical induction that the complexity of binary search algorithm is log n?
The complexity of the binary search algorithm is log(n)...
If you have n items to search, you iteratively pick the middle item and compare it to the search term. Based on that comparision, you then halve the search space and try again. The number of times that you can halve the search space is the same as log2n. This is why we say that binary search is complexity log(n).
We drop the base 2, on the assumption that all methods will have a similar base, and we are really just comparing on the same basis, i.e. apples against apples, so to speak.
How do you count the no of keywords in c?
1. Get the list of the keywords.
2. Use your fingers to count.
Your question isn't a question, but here is the answer:
double divide (int p, int q);
Highlight the steps involve in writing a functional program?
Consult or think about the requirements; plan the general design; write your program; test it; correct and test (probably several times) until it works.
In a larger project, you will probably do the above for each individual component at a time, i.e., you will be adding components gradually.
Consult or think about the requirements; plan the general design; write your program; test it; correct and test (probably several times) until it works.
In a larger project, you will probably do the above for each individual component at a time, i.e., you will be adding components gradually.
Consult or think about the requirements; plan the general design; write your program; test it; correct and test (probably several times) until it works.
In a larger project, you will probably do the above for each individual component at a time, i.e., you will be adding components gradually.
Consult or think about the requirements; plan the general design; write your program; test it; correct and test (probably several times) until it works.
In a larger project, you will probably do the above for each individual component at a time, i.e., you will be adding components gradually.
What is algorithm to write algorithm to the program to access a pointer variable in structure?
Here is the algorithm of the algorithm to write an algorithm to access a pointer in a variable. Algorithmically.
name_of_the_structure dot name_of_the _field,
eg:
mystruct.pointerfield
How do you open C when it prompts you to choose the program to open it with with in a list?
edit your autorun.inf file, add the line
open=C:\windows\explorer.exe
good luck
Kevin
What is a double stack magazine?
The magazine of a gun holds the bullets. Most magazines are single stack - each bullet directly above the next. Double stack magazines have 2 rows of bullets, slightly staggered.
int AverageEvenNumbers( int n )
{
return ( n / 2 ) + 1;
}
n / 2 will always give you an int, aka no decimals
if n is 5 the even numbers are 2 and 4, the average is 3
(5) / 2 is 2
2 + 1 is 3
if n is 10 the even numbers are 2 4 6 8 10, the average is 6
10 / 2 is 5
5 + 1 is 6
enjoy
Which Loop avoids check at every iteration?
All loops available in Java (for, while, do-while) have a loop termination condition that would get executed during every iteration of the loop. Without checking the loop condition the loop cannot be terminated and hence avoiding the loop condition check during iteration is not logic and Java does not do it.
What type of document is the Declaration of Independence?
It is an enlightened document. The reason for this is because it is based off of philosophies which came from The Enlightenment period.
It identified and focused on principles and issues that would unify the various colonial groups.
Write a C program to read the internal test marks of 25 students in a class and
show the number of students who have scored more than 50% in the test.
Make necessary assumptions
Write program to convert a string in lower case without using library function?
It is not certain if the question asked to convert lower case to upper case, or upper case to lower case. This answer assumes the latter. You could easily change this around for the former.
ConvertToLower (char*psz) {
while (*psz != '\0') {
switch (*psz) {
case 'A': *psz = 'a'; break;
case 'B': *psz = 'b'; break;
case 'C': *psz = 'c'; break;
case 'D': *psz = 'd'; break;
case 'E': *psz = 'e'; break;
case 'F': *psz = 'f'; break;
case 'G': *psz = 'g'; break;
case 'H': *psz = 'h'; break;
case 'I': *psz = 'i'; break;
case 'J': *psz = 'j'; break;
case 'K': *psz = 'k'; break;
case 'L': *psz = 'l'; break;
case 'M': *psz = 'm'; break;
case 'N': *psz = 'n'; break;
case 'O': *psz = 'o'; break;
case 'P': *psz = 'p'; break;
case 'Q': *psz = 'q'; break;
case 'R': *psz = 'r'; break;
case 'S': *psz = 's'; break;
case 'T': *psz = 't'; break;
case 'U': *psz = 'u'; break;
case 'V': *psz = 'v'; break;
case 'W': *psz = 'w'; break;
case 'X': *psz = 'x'; break;
case 'Y': *psz = 'y'; break;
case 'Z': *psz = 'z'; break;
}
psz++;
}
Warning. Do not be tempted to replace the switch statement with ...
if (*psz >= 'A' && *psz <= 'Z') *psz += 32;
... because that will only work on ASCII implementations, and it is most definitely not portable, such as in EBCDIC implementations.
What is the difference between left recursion and right recursion in a grammar?
Recursion is what it's called when a function calls itself. When a function calls itself immediately before returning, it's called tail recursion. Tail recursion can be more efficiently written as iteration. In fact a good compiler will recognize tail recursion and compile it as iteration.
There is no such thing as left or right recursion in C programming.
How do you convert decimal number 63 to binary?
The binary equivalent of the decimal number 63 is 111111.
Write a Program to convert decimal number into hexadecimal no without using function and string?
This is not a question.
How much are the size of memories of in built data types of C plus plus?
sizeof (typename) will tell you.
Here are some possible variations:
WinDos 16/small:
1: char
2: short, int, pointer
4: long
WinDos 16/large:
1: char
2: short, int
4: long, pointer
Windows 32, unix 32:
1: char
2: short
4: int, long, pointer
8: long long
Windows 64:
1: char
2: short
4: int, long
8: long long, pointer
Unix 64:
1: char
2: short
4: int
8: long, long long, pointer
What is an algorithm to print the Fibonacci series 0123 up to n terms?
void print_fib (unsigned terms) {
unsigned f1 = 0; // the first term
unsigned f2 = 1; // the second term
while (terms--) {
std::cout<<f1<<std::endl;
unsigned f3 = f1 + f2; // the next term
f1 = f2; // shift the terms for the next iteration
f2 = f3;
}
}
comment n' critisize constructive criticism command and conquer Computer Numerical Control