answersLogoWhite

0

📱

Computer Programming

A category for questions about computer programming and programming languages.

10,506 Questions

How do you separating nibbles in 8085 assembly language?

A nibble (half-byte) is transferred in the 8085 by reading the destination, masking the alternate nibble, adding the nibble, and storing the result. For example, to store the low order nibble at location 1000H to the byte at location 1001H, you could use...

LDA 1001H

XRI 0F0H

STA 1001H

LXI H,1001H

LDA 1000H

XRI 0FH

ADD M

What are the characteristic features of the procedural programming languages?

- Easy location of errors in the program

- Easy understanding of the program code

- Execution of the pogram is faster

- The program becomes neat (commenting the program codes)

Jimmy C. Malusi (jimmy20clinton@live.com)

What is the purpose of an array?

An array is a sequence of logically related data items. It is a kind of row mad of boxes with each box holding a value . Each box can be accessed by , first box , second box, third box, so on. till the nth

box.

( submit by keshaw kumar Bokaro Niit)

What is the language of compiler of c plus plus?

C++ is a general purpose, cross platform, object-oriented programming language that compiles to native machine code. Although it supports OOP, it does not rely on it. You can mix C++ code with C-style code and even Assembly Language routines.

How do you reverse a string in assembly language?

program:

assume cs:code,ds:data

code segment

mov ax,data

mov ds,ax

mov cl,count

mov si,offset str1

mov di,0003h

back:mov al,[si]

xchg [di],al

mov [si],al

inc si

dec di

dec cl

jnz back

hlt

code ends

data segment

str1 db 01h,02h,03h,04h

count equ 02h

data ends

end

result:

input: str1 (ds:0000h) = 01h,02h,03h,04h

output: str1 (ds:0000h) = 04h,03h,02h,01h

How do you make a window full screen?

Well, if we're talking about Windows you should make the window as big as the display resolution, and use ITaskbarList2::MarkFullscreenWindow to make sure the taskbar has lower z-order than your window.

What are the applications of Differential equations in the field of computer programming?

There are several applications of differential equations...

To begin with, there is the typical distance with respect to time (e.g. finding the rate of change between two cars after four hours if they start at a point and move in a 90 degree angle from each other). The differential equation is also used in physics with Newton's Second Law of Motion and the Law of Cooling. It can also be used in Hooke's Law for modeling the motion of a spring or in representing models for population growth and money flow/circulation. There are many other applications and there are many equations out there that can be used to set up and solve day-to-day problems.

Experience: Calculus 2 student

How c plus plus is a procedure based language?

C is both.

The characteristics of a procedural oriented language: assignment operators (:= in C)

The characteristics of a structured programming language: block of codes ({} in C) for if-else, while-, for- loops, subroutines, etc.

How do you program a astrostart j5f tx2000?

Strugari

Get under the dash to the unit.

You will see 8 or 9 dip switches on the unit with an LED beside them.

Turn switch 1 and 8 on.

Press and release the brake. (LED will flash)

Press and hold start button on remote. (LED will flash and parklights will flash once.

Turn switch 1 and 8 to off.

Press and release the brake (LED will flash once)

Try your new remote!

What is md5 protocol?

MD5 (like SHA-1 or CRC32) is a common message-digest algorithm for data integrity. MD5 is widely used as a cryptographic hash function producing a 128-bit (16-byte) hash value or checksum, typically expressed in text format as a 32 digit hexadecimal number (e.g. 90506d869e65e896d5a8474b00097610).

This essentially is a way to digitally sign a block of text or media to prevent tampering or modification. A receiver can calculate the md5 hash value independently to verify the contents match the expected hash value. If a different hash value is computed then the content has been changed from the original.

The newer SHA-1, SHA-256, and SHA-512 algorithms respectively generate a 160-bit, 256-bit, and 512-bit hash value for greater security.

What is static and dynamic data structure?

In dyanamic data structure emory allocation for the data structure takes place at run time,only requered amount of memory is allocated(eg.linked lists).In static data structure memory is reseved at the time of compilation(eg.arrays).

Differentiate between interpreter and complier?

Compiler compiles code into binary program, which is then ran by operating system or a virtual machine(Java or C#)

Interpreter steps trough code, doing instructions one after another, without any compilation or optimization.

C program for gcd of two numbers using functions?

#define SIZE 100

#include <stdio.h>

int hcf_function(int,int);

int lcm_function(int,int);

int main()

{

int array[SIZE],n,i,choice,LCM,hcf;

printf("Enter No of Elements\n");

scanf("%d",&n);

printf("Enter Elements\n");

for(i=0;i<n;i++)

scanf("%d",&array[i]);

do

{

printf("\n\nEnter Choice\n\n1.HCF\n2.LCM\n3.Exit\n");

scanf("%d",&choice);

switch(choice)

{

case 1: hcf=array[0];

for(i=1;i<n;i++)

hcf=hcf_function(hcf,array[i]);

printf("\nHCF = %d",hcf);

break;

case 2: LCM=array[0];

for(i=1;i<n;i++)

LCM=lcm_function(LCM,array[i]);

printf("\nLCM = %d",LCM);

break;

case 3: break;

default:printf("Wrong Choice");

break;

}

}while(choice!=3);

}

/***************************************************************

Function Name : hcf_function

Purpose : to find hcf

Input : two numbers

Return Value : hcf

Return Type : int

****************************************************************/

int hcf_function(int m,int n)

{

int temp,reminder;

if(m<n)

{

temp=m;

m=n;

n=temp;

}

while(1)

{

reminder=m%n;

if(reminder==0)

return n;

else

m=n;

n=reminder;

}

}

/***************************************************************

Function Name : lcm_function

Purpose : to find LCM

Input : two numbers

Return Value : LCM

Return Type : int

****************************************************************/

int lcm_function(int m,int n)

{

int LCM;

LCM=m*n/hcf_function(m,n);

return LCM;

}

What are examples of programming languages?

C, C++ and java are a couple. There are still many other programming language.

What is Difference between class and object of a class?

A class is an abstract idea. It's that "thing" you wrote the source code for.

An object is an instance of a class.

Example:

// Integer is the class; i is the instance of class Integer

Integer i;

What is parameter constructor?

C++ permits us to achieve this objects bt passing argument to the constructor function when the object are created . The constructor that can take arguments are called parametrized constructors

Example:-

class abc

{

int m,n;

public:

abc(int x,int y); //paramererise constructor

................

.................

};

abc::abc(int x,int y)

{

m=x;n=y;

}

Word size of todays processors?

Modern Computers have a word size of 16, 32 or 64 bits.

What is the Programming environment?

All desktop computers are composed of at least two main parts: a monitor or display device, and a case where the computer's internal systems are stored. Most commonly, this case is a separate "tower" that is connected to the monitor, but some desktops have the monitor and other hardware integrated into one unit. An operating system loaded on a hard drive allows the computer to display an interactive environment.

What are some of the databases you interact with?

We interact with many databases in our everyday life like credit car transactions, cell phones, internet and more. Interaction with database has made life easier and simpler.

What is the time complexity for searching an element in an array?

If the array is unsorted, the complexity is O(n) for the worst case. Otherwise O(log n) using binary search.

On which machine was the first programming language developed?

The first programming language was machine code, the native language of the machine. Every machine type has its own version of machine code but we can trace the earliest example of machine code back to the days of the semi-automatic weaving loom invented by Basile Bouchon in 1725.

Strictly-speaking, machine code is not a programming language. Programming languages are human languages, a means of producing machine code through symbolic abstractions that are much easier for humans to interpret than native machine code. It should also be noted that programming languages are never developed on a machine, the language is purely abstract and designed according to a specified proposals. The only thing that is actually developed on the machine is the implementation of the machine code program that physically converts the symbolic instruction code into the machine's own native machine code. Before we had any programming languages, all programs had to be written in the machine's own native machine code. Once we had one programming language, we could use it to create translators for other languages and indeed for other machines besides the one on which it executed.

Note that it's difficult to know precisely when programming languages were first used because there were many language pioneers working simultaneously, often sharing ideas and evolving designs to the point that it is difficult to determine at what point a language is "fit for human consumption", so to speak. To make matters worse, many early programming languages were proposed but never designed, while others were designed but never implemented.

Assembly language is the next step up from machine code. Like machine code, every machine type has its own version of assembly language, and is therefore a low-level language. Unlike machine code, code written in assembly language has to be translated into native machine code before it can be executed because machine code is the one and only language "understood" by the machine. Converting from assembly language to machine code is as tedious and as error prone as writing the machine code itself, however the actual conversion process is trivial enough that we can easily write a small machine code program (known as an assembler) to perform the conversion for us. The earliest known usage of an assembly language dates from 1949 on the EDSAC computer at Cambridge University, where the assembler (known as Initial Orders) was implemented in read-only memory. The inventors were Maurice Wilkes and W. Renwick.

High-level languages are more abstract than assembly languages and are generally more portable (not machine dependent). The first high-level programming language was probably Autocode in 1952 on the Mark I computer at the University of Manchester, or Short Code in the same year on the UNIVAC 1. Short Code was based upon an earlier implementation known as Brief Code in 1949 for the BINAC computer, but it was never tested or debugged. Autocode used a compiler program to convert the high-level symbolic code into machine code whereas Short Code used an interpretation program. The difference between the two is that the native machine code produced by a compiler can be stored and executed without any further translation whereas code written in an interpreted language has to be converted by the interpreter program every time it is executed. As a result, compiled programs perform better than interpreted programs.

Modern-day Java is an example of a programming language that is both compiled and interpreted. Unlike a traditional compiler, the Java compiler produces byte code which can then be interpreted to produce native machine code. The reason for this multi-conversion is that the same byte code can be executed upon any machine with a Java virtual machine implementation. That is, the byte code is the native language of the virtual machine and is much quicker to interpret than the higher-level source code would be. It also ensures that the intellectual property -- the source code itself -- is not revealed to the user.

It is worth noting that Plankalkül was designed from 1943 to 1945 for the Z3 and therefore predates assembly language as well as Autocode and Short Code. However it was not actually implemented until 1998, more than 50 years after it was designed!

What are disadvantages of event driven programming?

  1. This method may not be useful for large, unique or highly complex projects
  2. This method cannot be a success if the team is not sufficiently motivated and nor is unable to work cohesively together.
  3. Success depends on the extremely high technical skills of the developers.
  4. There are times when the team ignores necessary quality parameters such as consistency, reliability and standardization. Hence this can make project quality management hard to implement during the project management life cycle

Can you use visual c plus plus for window programming in c language?

... yes?

The question doesn't really make any sense. Any language can be used to program a computer, so long as you have a compiler for it. There definitely are both C and C++ compilers for Microsoft Windows, therefore you can write device drivers in it if you want.

Heck, you could theoretically write device drivers in LISP or BASIC if you wanted; I personally wouldn't, but it could be done.

How do object oriented design and structure design differ?

Object Oriented programming is a superset of structured programming. Structured programming is as follows:

--Program start

var

var

var

function { ... }

function { ... }

function { ... }

main { ... }

--- Program End

You have units of code, which operate on variables, and are called in reference to those variables, to follow a structure acting on those variables.

Object oriented is as follows:

--- Program Start

object {

var

var

function { ... }

function { ... }

function { ... }

}

var

var

function { ... }

main { ... }

--- Program end

Variables can be objects, which have their own data and functions. Think like C and structures, except structures can have functions "in them" which operate specificly on their own data. Thus, instead of referencing a function (a block of code) and telling it to operate on a variableq you reference an object and tell it to perform an operation, most often on itself, specific to itself, using its own data. Instead of creating units of data to pass to functions which operate on them, you create objects and have them perform operations [on themselves].

Functions attached to objects don't need a specific name; rather than task_struct_sort_children(task) and acl_rules_struct_sort_children(task), you can have task and acl_rules with task->sort_children() and acl_rules->sort_children(), which have completely different specific function but the same logical function, and operate on the specific instance of the object.

structured oriented programming and object oriented programming have some features of similarities, but the distinction between the two is that the former relies to the GOTO statements thus the developer has a tendency to confuse while the latter is subgrouped from objects, classes, methods and hierarchies.