Need of structured programming?
That basically refers to a programming language that has support for conditional statements (if), code repetition (while, for, ...), and subroutine or function calls. Most modern language have that. The term is also sometimes used for languages that do NOT work with OOP. Actually OOP includes the structured programming concepts mentioned above, but it includes a few other things, too.
What is the code for a C program to find the largest and smallest number?
Fist of all, let's assume that by "list" you mean "array." Otherwise we would need your list implementation in order to be able to iterate through the elements.
int[] nums; // assume these are the numbers you want to search through
int nums_length; // also assume that we know how many numbers are in nums
int min; // smallest number in nums
int max; // largest number in nums
// special case for an empty list of numbers: set min = max = 0
if(nums_length == 0) {
min = 0;
max = 0;
}else {
// start min and max off as equal to the first number
min = nums[0];
max = nums[0];
// iterate through nums
int i;
for(i = 1; i < nums_length; ++i) {
// update max, if necessary
if( nums[i] > max ) {
max = nums[i];
}
// update min, if necessary
if(nums[i] < min) {
min = nums[i];
}
}
}
// min and max are now properly set (or both equal to 0 if nums is empty)
What is the if-then-else structure?
This is one of the most simple flow control mechanisms in programming. It follows very closely to the spoken-language version.
IF something is true
THEN do something
ELSE do something else
if x == 1
print "x is one!"
else
print "x is not one!"
Though the size of a cache has increased over time, so too has the size of hard disk. An economical comparison of cache versus hard disk space in a cost per MB analsysis will show that a cache would be significantly more expensive. Furthermore, cache in general is considered "temporary" or volatile storage which means that the contents of the storage device is lost when the system is powered off. A hard disk, on the other hand, is "long term" or non-volatile storage; when the system is powered off, the hard disk still safely holds the data stored on it.
Explain the features of doubly linked list?
Well, in a singly linked list you can only move forward, if the pointer you seek is behind your current position you'll have to cross the hole list to get there. In a doubly linked list you can simply move back as well as forward....
hope this helps...
What is object in programming?
Object in context of a class is the root of the class hierarchy in Java in the java.lang package.
Every class has Object as a superclass whether it's explicit or not. All objects, including arrays, implement the methods of this class.
Is machine language a programming language?
Actual Machine level language is binary language, which contains only '0' & '1 ' and it's the extreme besic of a computer's instruction. Then comes low level language, like assembly language and so on.
Explain what is meant by object-oriented concept of abstraction?
Data abstraction is the means by which we lift the level of abstraction away from the machine (low-level) and closer to the application domain (high-level). As far as the machine is concerned, all data is binary, however the exact same binary representation can mean entirely different things within different contexts. Abstraction allows us to separate these contexts and thus give much greater meaning to the underlying representation.
What is the full form of PASCAL?
PASCAL has 3 definitions actually. They are:-
1. Programming Language Based For Blaise Pascal.
2. Pedantry and Strictness Created A Language.
3. Philips Automatic Source Calculator.
How do you move files from Ares to windows media player?
To move files from Ares to Windows media player, click on Library, found in Windows media player 11. Then click on Add to Library option and select the folder where Ares files were downloaded.
What are examples of machine level language?
Machine language is nothing but numeric codes. Because humans have a difficult time remembering numeric codes, manufacturers of microprocessors create mnemonics; these sets of mnemonics are called assembly language. Each processor family has its own set of mnemonics, or assembly language, so assembly for the Intel processor used in many PCs is different from the assembly for a Motorola processor. In fact the assembly for different processors made by the same manufacturer will have assembly that differs, sometimes by a little, sometimes significantly. A quick example of one type of Motorola assembly, to clear 10 32-bit memory locations might look like this:
movea #$6000,ao
move.l #10,d7
10$
clr.l (a0+)
subq.l #1,d7
bne.s 10$
rts
Convert single linked list to double linked list?
You copy a singly linked list into a doubly linked list by iterating over the singly linked list and, for each element, calling the doubly linked list insert function.
What is difference between code and standard and specification?
A Standard can be defined as a set of technical definitions and guidelines that
function as instructions for designers, manufacturers, operators, or users of
equipment.
A standard becomes a Code when it has been adopted by one or more
governmental bodies and is enforceable by law, or when it has been incorporated
into a business contract.
Example of procedural programming language and object oriented programming language?
example of procedural programming are those programming language that have structure e.g basic,fortran,c++,c and pascal e.t.c
What skills do you need to be a computer programmer?
Well first off, you need to know how to spell programmer. (you spelled it wrong).
J.K.
You must have a knowledge of the programming language.
Ex. C#, C++,.NET,Flash, Java.
You must have a sense of logic, and be good at math and physics.
What are the misuses of Internet?
Some misuses are:
If it's illegal in real life, it means you can't do it on the computer. Contrary to some self-serving beliefs, actions taken using the internet have effects on real people in real life.
What is the algorithm to delete a child node in binary tree?
as far as i know u have 4 cases for the node u wanna delete
1.It's a leaf (has no children)
2.It has only left child
3.it has only right child
4.it has both children ,left and right
now, let's work on it :>
set a pointer node to the root
while the element to be deleted doesnt equal the pointer
if it's smaller, move the pointer to the left subtree
if it's large , move the pointer to the right subtree
if pointer reached the end of the tree , null, break the loop (unluckly that means u didnt find the element that should be removed)
end while //(now u must have found the target, the while condition is breaked normally)
// this is case 4
if both children don't equal null
get the most left node in the subtree of the pointer node
assign its value to the pointer node.
remove it (set that most left thing to equal null)
//...case 2
if pointer node.right only equals null
pointer node = pointer node.left
//...case3
if pointer node.left only equals null
pointer node = pointer node.right
//... case 1
if pointer node.left and .right equals null
pointer node.data = null
maybe it doesnt look like any algorithm style ,sorry for that, that's as far as i knw, i doubt case 4 anyways..
What is the special formatting languages used to create webpages?
HTML, the HyperText Markup Language, defines web pages' content; CSS, Cascading Style Sheets, defines the web pages' presentation; and JavaScript, defines interactivity with the user, creating "Rich Internet Applications" (RIA).
1-6 sequence numbers.
7 (*) for comment (-) for continue (D) for debugging.
8-11 called as Area-A in this Area we can write
Divisions,Paragraphs,sections,Level numbers.
12-72 called as Area-B in this area we can write cobol
executable statements like select,accept,display.
73-80 is ignored area by compiler but we can see in source
Listing.
Why the concept of inheritance was introduced in OOP?
In object-oriented programming, inheritance allows the creation of is-a relationships. For example, a car is a vehicle, and a bike is a vehicle, so those could be modeled through a vehicle class, and a pair of car and bike classes, both derived from (inheriting from) the vehicle class. Derived classes like car and bike share common vehicle properties, such as speed, location, direction, number of wheels, etc.
What is program of Swapping of two numbers in assembly language?
LDA A //Load first number
STA TMP
LDA B //Load second number
STA A
LDA TMP
STA B
HLT
IMPROVED:
You can visit the link below to see the source code of the program. Make sure you have required library installed in MASM to run the program else you can see the logic and coding.
http://infinityloopers.com/swapping-two-numbers-in-assembly-programming/
How to write Program to swap two variables using function call by value?
//This program swaps the values in the variable using function containing reference arguments
#include<iostream.h>
void swap(int &iNum1, int &iNum2);
void main()
{
int iVar1, iVar2;
cout<<"Enter two numbers "<<endl;
cin>>iVar1;
cin>>iVar2;
swap(iVar1, iVar2);
cout<<"In main "<<iVar1<<" "<<iVar2<<endl;
}
void swap(int &iNum1, int &iNum2)
{
int iTemp;
iTemp = iNum1;
iNum1 = iNum2;
iNum2 = iTemp;
cout<<"In swap "<<iNum1<<" "<<iNum2<<endl;
}
Reference arguments are indicated by an ampersand (&) preceding the argument:
int &iNUm1;
the ampersand (&) indicates that iNum1 is an alias for iVar1 which is passed as an argument.
The function declaration must have an ampersand following the data type of the argument:
void swap(int &iNum1, int &iNum2)
The ampersand sign is not used during the function call:
swap(iVar1, iVar2);
The sample output is
Enter two numbers
12
24
In swap 24 12
In main 24 12
------------------------------------------------------------------
By Satish from here
/ * Program to Swap Two Numbers by Using Call By Reference Method * /
#include
main()
{
int i, j;
clrscr();
printf("Please Enter the First Number in A : ");
scanf("%d",&i);
printf("\nPlease Enter the Second Number in B : ");
scanf("%d",&j);
swapr(&i,&j); /* call by reference*/
printf("A is now in B : %d",i);
printf("B is now in A : %d",j);
}
/* call by reference function*/
swapr(int *x, int *y)
{
int t;
t=*x;
*x=*y;
*y=t;
}
What is the basic Elements of artificial intelligence in detail?
Learning, reasoning, problem-solving, perception, and language understanding are the five fundamental components of artificial intelligence. All products and services that employ artificial intelligence solutions consider these five fundamental components such as Apple's Siri, Amazon's Alexa, and more. Visit us online for further related info!
What is the role of a compiler?
The compiler converts source code (the stuff the programmer wrote and is human readable) and converts it to machine code that the computers CPU can understand. The conversion is used to make an executable program.
The compiler can also make libraries but libraries are not executable by them selves.