Machine code is the ONLY example of machine language. However, every machine architecture has its own version of machine code; it is the native language of the machine. If you want to examine machine code upon your own machine, use a hex editor. This will show you every byte of the code in hexadecimal form.
An Integrated Development Environment (IDE) refers to several software tools combined into a single program, or a group of programs that work together as if they were a single program.
IDE's can also manage large programming projects where code may be spread out over many different files.
the amount of energy exercited during an activty or exercise
Prims Algorithm is used when the given graph is dense , whereas Kruskals is used when the given is sparse,we consider this because of their time complexities even though both of them perform the same function of finding minimum spanning tree.
ismailahmed syed
Who introduced the Stored Program concept?
The exact person is unknown, but it was developed late in WW2 on the ENIAC project. John von Neuman is commonly credited with it because after long conversation with the University of Pennsylvania people who had worked on ENIAC and were planning a new computer incorporating a stored program called EDVAC, he wrote a paper on the subject summarizing the ideas discussed. Unfortunately the First Draft of this paper "escaped" before it could be revised, corrected, and all relevant names added. Only von Neuman's name was listed.
Write a c program to find the maximum value of 25 element in an array?
int findMax(int *array)
{
int max = array[0];
for(int i = 1; i < array.length(); i++)
{
if(array[i] > max)
max = array[i]
}
return max;
}
C code for linear programming problem?
#include<stdio.h>
#include<conio.h>
#include<string.h>
void main()
{
int first,last,flag=1;
char str[100];
clrscr();
printf("Enter number to get to check wheather palindrome or not");
gets(str);
first=0;
last=strlen(str)-1;
printf("%d",first);
printf("%d",last);
while(first<=last)
{
if(str[first]!=str[last])
flag=0;
first++;
last--;
}
if(flag==1)
{
clrscr();
printf("this is palindrome");
getch();
}
else
{
clrscr();
printf("sorry this is not a palindrome");
getch();
}
}
What is the significance of asmlinkage modifier in C?
The asmlinkage tag tells gcc that that the function should not expect to find any of its arguments in registers (a common optimization), but only on the CPU's stack. Many kernel functions use the fact, that system_call consumes its first argument, the system call number, and leaves other arguments (which were passed to it in registers) on the stack. All system calls are marked with the asmlinkage tag, so they all look to the stack for arguments.
See how Convert the decimal numbers 1987 to binary then to octal?
to convert decimal to binary, repeatedly divide the value by 2, taking the remainder until the value is 1 or 0.
1987 / 2 = 993 r 1
993 / 2 = 496 r 1
496 / 2 = 248 r 0
248 / 2 = 124 r 0
124 / 2 = 62 r 0
62 / 2 = 31 r 0
31 / 2 = 15 r 1
15 / 2 = 7 r 1
7 / 2 = 3 r 1
3 / 2 = 1 r 1
1 / 1 = 1
Thus: 1987 in binary is 11111000011.
Proof (binary back to decimal):
1 * 2^0 = 1
1 * 2^1 = 2
0 * 2^2 = 0
0 * 2^3 = 0
0 * 2^4 = 0
0 * 2^5 = 0
1 * 2^6 = 64
1 * 2^7 = 128
1 * 2^8 = 256
1 * 2^9 = 512
1 * 2^10 = 1024
1024 + 512 + 256 + 128 + 64 + 2 + 1 = 1987
To convert to octal, split the binary value into groups of 3 bits:
11 111 000 011
Pad the first group with zeroes to make 3 bits if necessary:
011 111 000 011
Convert each group to its equivalent octal digit according to the following table:
000 = 0
001 = 1
010 = 2
011 = 3
100 = 4
101 = 5
110 = 6
111 = 7
Therefore: 011 111 000 011 = 3 7 0 3
Thus: 1987 in octal is 3703.
Proof:
3 * 8^0 = 3
0 * 8^1 = 0
7 * 8^2 = 448
3 * 8^3 = 1536
1536 + 448 + 3 = 1987
What are the types to pass a structure to functions?
A structure is a type so you just need to pass the structure as you would any other data type: by reference or by value.
What value is stored in an uninitialised variable?
The value of an uninitialised variable will be whatever value happens to reside in the allocated memory when that variable is instantiated. Attempting to access that value will result in undefined behaviour.
There advantages to uninitialised variables. For instance, when allocating a large amount of memory prior to a memory copy, there's no point in initialising the memory since it will be initialised by the copy operation.
In object-oriented programming, uninitialised variables do not exist. All variables are initialised at the point of instantiation via the object's class constructor. However, if the language also supports primitive data types (as C++ does), then those types will generally be uninitialised since primitives have no constructors.
The heap refers to the free store, which basically means the total unused memory available to you. The physical amount of memory will vary from system to system and the amount of memory available will depend upon how much is currently in use. However memory fragmentation means that while there may be sufficient physical memory available to meet an allocation request it does not follow that there is a large enough block of contiguous memory available, resulting in an out of memory error.
Modern systems use virtual memory addresses rather than physical ones. This allows the memory manager to physically move objects around in memory without affecting the virtual addresses allocated to those objects and thus makes it possible to consolidate memory fragments. Objects that are not in use can also be paged out to a disk file, thus making it seem like there's far more memory available than physically exists.
Write a recursive procedure to compute the factorial of a number?
#include <iostream>
using namespace std;
int main()
{
int i, number=0, factorial=1;
// User input must be an integer number between 1 and 10
while(number<1 number>10)
{
cout << "Enter integer number (1-10) = ";
cin >> number;
}
// Calculate the factorial with a FOR loop
for(i=1; i<=number; i++)
{
factorial = factorial*i;
}
// Output result
cout << "Factorial = " << factorial << endl;
The first part is true (malloc allocates a single block of storage) but the second part is not. Malloc is for allocating un-initialized memory. calloc initializes all bytes to 0.
What is Basic elements of artificial intelligence?
includes robotics, vision systems, natural language processing, learmning systems, neural networks and expert systems.
Difference between code segment and data segment of an instruction?
In the 8086/8088 microprocessor, the code segment is used to fetch the opcode and any additional instruction bytes that might be part of the instruction, while the data segment is used to fetch and/or store any operand bytes that the instruction requires to be manipulated.
This is in the case of no segment override prefix.
What is drawback of writing the definitions of all the functions before main function?
If you write out the functions before you write main, you will probably have to return to the functions after outlining main and correct them so that they interact with main as they should. In the long run, it is far better to write main first, so that you understand exactly what you want each function to do before you write the function, so that you don't have to go back and correct them.
What is the difference between a fixed size array and a variable size array?
The obvious answer is that one has a constant size while the other does not. More specifically, a fixed-size array is one where the size is known at compile time and does not change at runtime. By contrast, the size of a variable-sized array may or may not be known at compile time but may change at runtime.
We often refer to a variable-size array as being a dynamic array, however some people (myself included) incorrectly refer to a fixed-size array as being a static array. The misunderstanding largely comes from the fact that we often refer to the heap (or free store) as being dynamic memory because all dynamic variables are allocated there (including variable-size arrays). But the term dynamic array does not refer to the memory, it refers to the dynamic -- as in changeable -- nature of the array itself.
By contrast, a fixed-size array is only deemed static if it is statically allocated, in which case it will be allocated in the program's data segment along with all other static variables, global variables and constants. But a local fixed-size array is allocated on the program's stack and is therefore, by definition, non-static. Moreover, you can allocate a fixed-size array on the heap!