What is difference between stack pointer and program counter?
Both of them are pointers, but otherwise they are completely unrelated. The former points to the current position of the stack, the latter points to the current instruction of the program.
to translate mnemonic operation codes to their machine language equivalents and assigning machine address to symbolic labels used by the programmer.
How do you sort an array of numbers?
Use a sorting algorithm. There are a bewildering number of sorting algorithms, both stable and unstable. To sort numbers, an unstable sort suffices. The algorithm you use will depend on how many numbers need to be sorted (a small or a large set), however a hybrid algorithm (a combination of two or more algorithms) can cater for both. Introsort (unstable) and timsort (stable) are the two most common hybrid sorting algorithms.
Why was assembly code created?
To program computers without having to memorize all of the numeric opcodes and other values used in machine code.
However assembly code is exactly as machine specific and tedious to program with as is machine code. The program has to be completely rewritten from scratch in another assembly language to port the program to a different computer.
High Level Languages were created to allow programming to be done in terms that people more easily understand and to simplify porting programs to different computers.
IBM Mathematical Formula Translating System
(if I understood your question)
What do you mean by a low level language?
A low-level programming language is one that has little to no abstraction between the source code and the machine code produced by the language translator. Machine code has no abstraction whatsoever and is the lowest possible level of coding (machine code is the native language of the machine). Assembly language has very little abstraction because each mnemonic either maps 1:1 with a specific machine operation code (opcode), or maps to one of several opcodes that only differ by the operand types and can be implied from those operands.
Given the lack of abstraction, low-level code is machine-dependent code and is therefore non-portable. That is, code is written specifically to suit the assembler and thus the machine it was intended to execute upon. Conversely, high-level code has a high-level of abstraction and is generally portable. That is, code is written to suit the language compiler or interpreter rather than underlying hardware. High-level languages generally provide a much more convenient method of producing low-level code that is much easier for humans to read, write and maintain, largely due to the high-level of abstraction these languages provide.
How do you access and store the elements of array?
#include<stdio.h>
#include<conio.h>
int main(void)
{
int a[10],i;//array declaration
clrscr();
printf("\n enter the elements of array");
for(i=0;i<10;i++)
scanf("%d",&a[i]);
printf("\n the elements you enter into the array");
for(i=0;i<10;i++)
printf("%5d",a[i]);
getch();
return 0;
}
How procedural oriented programming language is interdependency?
Function which uses other function as part of it programming is known as function interdependent
Write a program in c to draw a star and rotate it?
// asterisk pyramid
#include<iostream>
using namespace std;
int main()
{
int count = 0;
for (int width = 0; width <= 10; width++)
{
for (int alignLeft = width; alignLeft <= 15; alignLeft++)
{
cout << " ";
}
for (int space = 1; space < count; space++)
{
cout << "*";
}
cout << endl;
count += 2;
}
return 0;
}
Is pseudocode a combination of programming language and machine code?
No. Pseudocode is not used to write complete programs; rather, it is an overview of what you want to achieve. For example, the following pseudocode is for a program to print a list of square roots:
for i = 1 to 10
show i, i*i
A specific programming language may not have a "show" command, and the structure of the "for" loop might be different; additional setup and cleanup commands may also be required in a real computer program; the purpose of this pseudoce is merely to explain, to a human, what you want to achieve. The real code, with more detail, will have to be added later.
Who created program for analytical engine?
It was Ada Augusta (1815-52), the daughter of Lord Byron, who had become the Countess of Lovelace when she married. She studied mathematics enthusiastically under the famous Augustus de Morgan. Lady Lovelace learned how the Analytical Engine worked from an English translation of an Italian report by L.F. Menabrea of a talk about it given by Charles Babbage in Turin in 1840.
How do you make chess game in c plus plus programming?
This question cannot be answered here. Go to amazon.com and find a book about chess-programming.
Many researches show that relationship between watching violence on TV and violent behavioral patterns is positively correlated. Can we statistically say from this information that viewing violence on television causes children to behave in a violent way?
What are constants in computer programming?
A constant may refer to a literal constant, a constant variable.
A literal constant is a value that we use to initialise or assign to a variable, literally, such as:
int x {42}; // initialise
x = 0; // assign
Here, the values 42 and 0 are literal constants.
A constant variable is a variable which will not change value after initialisation:
const int x {42}; // initialise
x = 69; // error - cannot assign to a constant variable
Constant variables are useful when we wish to use the same constant value repeatedly within a scope. We could also use a literal constant rather than a constant variable, however naming our constants makes it easier to refer to the value consistently, particularly during code maintenance where we may wish to review the value. With a constant variable we need only change the initialiser, but with literal constants we must change every occurrence of the literal and that can lead to inconsistencies. Consider the following:
int x[100];
int y[100];
for (int i=0; i<100; ++i) { cout << x[i] << endl; }
// ...
for (int i=0; i<100; ++i) { cout << y[i] << endl; }
Here we've used the literal constant 100 four times. At a future time we may decide array x really needs 200 elements rather than 100, but we have to be careful which literals we change because array y makes use of that same literal constant. Using constant variables helps keep those usages separate:
const int xmax {100};
const int ymax {100};
int x[xmax]; int y[ymax]; for (int i=0; i<xmax; ++i) { cout << x[i] << endl; } // ...
for (int i=0; i<ymax; ++i) { cout << y[i] << endl; }
Now we can safely change the xmax initialiser without affecting any usage of the ymax constant:
const int xmax {200};
const int ymax {100};
int x[xmax];
int y[ymax];
for (int i=0; i<xmax; ++i) { cout << x[i] << endl; }
// ...
for (int i=0; i<ymax; ++i) { cout << y[i] << endl; }
Note that a constant variable cannot be initialised by a non-constant variable:
int x {42};
const int y {x}; // error - x is non-constant
What is fact finding techniques?
# sampling of existing documentation. # research and site visits. # observation of the work enviroment. # questionaire.
What is physical data structure and logical data structure?
Physical data structure: This is the physical equipment involved in the network eg router, cabling etc).
Logical data structure: This is how the information flows internally and externally (the transfer of information from one node to another on the network).
Definite interations: Repeated sequence of calculations/ operations for a fixed number of repetitions. (Do or For loop) Indefinite iteration: no set limit on iterations, generally "while" loops. multiple interations is the same as multiple repetitions or trials.
What do you need to be a game designer?
Becoming a video game designer is not as easy as it seems. First off, you need a bachelors or masters degree preferably in computer science. Designing a video game requires a lot of skill in writing computer code. Excellent skills in math and writing would also be preferred. A well-written game also needs a well-written stroyline to keep players drawn. If you are just interested in the graphics in the game, then experience in the field of graphic design would suit you well.
C program for finding square root of positive no?
#include<stdio.h>
#include<conio.h>
float SquareRoot(float num);
void main()
{
float input, ans;
clrscr();
printf("\n Enter The Number : ");
scanf("%f", &input);
ans = SquareRoot(input);
printf("\n Square Root : %f", ans);
getch();
}
float SquareRoot(float num)
{
if(num >= 0)
{
float x = num;
int i;
for(i = 0; i < 20; i ++)
x = (((x * x) + num) / (2 * x));
return x;
}
}
Should element in an array must be of primitive data type?
No, it can be array, structure or union as well.
What do we call the numbers that cannot be arranged into 2-row arrays?
we can call the number that cannot be arranged into 2- row arrays multiple arrays.