How do you write a program to find number of zeros for the given number in c program?
Assuming the number is represented by a decimal integer, initialise a counter to zero, then repeatedly divide the number by 10 and until the number is zero. After each division, examine the remainder. Each time the remainder is zero, increment the counter.
If the number is represented by a decimal float, repeatedly multiply by 10 until the value is an integer, then perform the previous algorithm.
The compiler is responsible for what?
its just convert the source language of a program to target language at once.....whereas interpreter do it line wise....
Is sorting a binary search tree simple?
A binary search tree is already ordered. An in order traversal will give you a sorted list of nodes.
Linux command to find factorial of a number?
factor NUMBER
Example:
$ factor 815
815: 5 163
I think he meant more along the lines of the product of the numbers that add up to the number from 1.
So like this:
10! = 10 * 9 * 8 * 7 * 6 * 5 * 4 * 3 * 2 * 1
Unfortunately, I have not been able to find any command that does factorials. The 'bc' command would have been the perfect choice because of its abilities to calculate extremely high values like 2^1000. How ever since you know how factorials work (multiplication), you can actually just make one for yourself.
The commands:
let, bc, expr, [], etc are helpful for mathematical expressions in bash
What error occurs when a real value is attempted to be assigned to an integer variable?
real value needed
A compile time error i.e ..
Error: possible loss of precision: double, required: int
None, it will converted automagically.
What is the time complexity of Dijkstra's algorithm?
Dijkstra's original algorithm (published in 1959) has a time-complexity of O(N*N), where N is the number of nodes.
What is Runtime error 216 at 771544f1?
I fixed the problem by deleted the program 'Spyware Doctor' using the add or remove program Icon in Control Panel. Once I rebooted the computer, the problem was gone.
How do you delete the given string in java programming?
You usually do not need to delete a String, since when the program no longer refers to it, the garbage collector will clean it up.
How do you use 2-D array with malloc?
You use a 2-D array with malloc the same way you use any other structure or scalar with malloc. The malloc library call takes a single argument of type size_t (in bytes) and returns a void* pointer to a region of memory that is suitably aligned for any supported data type. An example using the 2-D array...
int *myArray[10][20];
myArray = malloc (sizeof (myArray));
if (myArray == NULL) {...exception processing...};
Note that a 2-D array is really the same as a 1-D array - its a linear region of memory - its just that the compiler does address arithmetic for you.
What does a smoke stack do on a steamship?
A smoke stack on a steamship vents exhaust from the ship's boiler to the air outside.
Which binary number is a respresentative of the decimal number 248?
11111000 (from the Windows Calculator)
What is the algorithm for first 20 multiples of 3?
let x = 3
for count = 1 to 20
print x
let x = x + 3
next count
Compare and contrast dynamic memory allocation and the allocation of files in secondary storage?
Static Memory Allocation: Allocating the total memory requirements that a data structure might need all at once without regard for the actual amount needed at execution time.
Dynamic Memory Allocation: The opposite strategy of static memory allocation - Dynamic Memory Allocation, involves allocating memory as-needed.
Find largest value algorithm in c?
** pseudo code ** if array length == 1, return first element else if array length > 1 max = first element for second item to last item if item > max max = item return max else // array length is 0 error
What is meant by development and deployment in java programming language?
These terms are not limited to Java programming.
Development refers to anything having to do with creating a program. Design and implementation fall under this category.
Deployment is delivering the program to other people.
An assembly language program that will take three decimal input and display minimum of them?
program that take three decimal number as input and find the largest among them in assembly language
The main objectives for PC world overall is the following:
Hope this helped!
What are the risks of using compiler interpreter assembler?
The error messages may be frustrating as they show that your program is not perfect... Or I do not know what risk you mean...
Describe an everyday situation between variables that is a function?
Te jump height on a trampoline vs. weight of a person