answersLogoWhite

0

📱

Computer Programming

A category for questions about computer programming and programming languages.

10,506 Questions

What is the scope of any variable?

The Scope of a variable defines the areas of a program where this variable would be visible and can be used. For ex:

a. Method variables - are visible only inside the method where they are declared and hence their scope is only the method

b. Class variables - are visible inside the class and can be used by any method inside the class and hence their scope is the whole class.

What is the process of the computers?

In computing, a process is a running instance of a program, including all variables and other state. A multitasking operating system switches between processes to give the appearance of simultaneous execution, though in fact only one process can be executing at once per CPU core. A process is the active element in a computer. Terminals, files, and other I/O devices communicate with each other through processes. Thus, network communications is interprocess communications (that is, communication between processes).

How do you write a program to read a value and display all prime numbers up to the value?

#include
#include

bool is_prime(unsigned num) {
unsigned max, factor;
if (num<2) return false;
if (!(num%2)) return num==2;
max = (unsigned) sqrt((double)num) + 1.0;
for (factor=3; factorif (!(num%factor)) return false;
return true;
}

int main() {

unsigned num;

for (num=1; num<=200; ++num)

if (is_prime(num)) printf ("%u is prime\n", num);

return 0;

}

What is the difference between register stacks and memory stacks?

Registers are normally memory spaces internal to the processor or very close to it. They are generally faster than main memory and will be small in size and will hold very frequently used data.

Register stacks are a set of such register memory locations.

Memory refers to computers main memory outside CPU. It is used to keep data and programs. Memory stack is a series of memory locations.
The difference between register stack and memory stack is...

What does MIPS stand for?

"millions of instructions per second", when referring to it as a benchmark. the processor architecture, however, doesn't really stand for anything. some computing enthusiasts will sarcastically say it stands for "meaningless indication of processor speed" because it is used so rarely and doesn't necessarily indicate a good mix of instructions that normal users will commonly use. FLOPS is a more common, and more useful, benchmarking number because it uses floating point operations, which tend to take much more computation time.

Give the program for finding smallest number in 8085 microprocessor?

.model small

.stack 64

.data

n1 db 08h,02h

res db ?

.code

mov ax,@data

mov ds,ax

mov cx,02

lea si,n1

mov bl,0ffh

mine:mov al,[si]

cmp al,bl

jne loop1

jmp loop2

loop1:jnc loop2

mov bl,al

inc si

loop mine

jmp exit

loop2:inc si

loop mine

exit:mov res,bl

hlt

end

Which one is good Microsoft dynamics nav online training center in Bangalore?

KBS Training Institute is one of the best and and NO 1 Microsoft Dynamics CRM Online Training Institute in Bangalore and This institution providing online training through out world Like Chennai,Bangalore,Mumbai,India,USA,UK,London,Singapore,Canada,Dubai,France, Japan, Germany, Australia, Middle East, GCC, UAE (Dubai, Abu Dhabi), Saudi Arabia, Qatar, Bahrain, Oman, Kuwait etc with all course material and the real time expertsteaches the trainees at any time which are flexible timings to the students, After training also we will support the qualified students like mock interviews, CV preparation and etc. Contact Details: KBS Training Institute, K.V.Rao, +91 9848677004, kbstraininghyd@gmail.com, info@kbstraining.com, India - Hyderabad - Bangalore. . ...

What are two advantages of using binary numbers rather than decimal numbers in a computer system?

Your question is actually flawed...binary system is not used in digital systems... Rather, systems using binary numbers only are called digital systems...

It is common knowledge that, digital electronics employs just 2 states (or rather numbers, as mathematicians put it...) the two numbers being '0' and '1'.

Obviously, it is easier to design electronic systems dealing with just 2 states...It's majorly this ease, that led to such exponential development in the field of digital electronics. It ios also cheaper to make or produce such systems...

Why you use curly braces in C programming?

Only the designers Brian Kernighan and Dennis Ritchie can answer this question. But I would guess it was because of the handy notation on the drawing board to represent the concept of BEGIN and END.

Telephone bill program written in java source codes?

I Want the Java Coding For Creating Phone Bill & Customer Name & Her Details, Plz Send The Coding For Creating Phone Bill,

Thank You

Regards

Suresh

What are some examples of assembly level language?

These days very few programs are written in assembly language. Some parts of operating system kernels are written in assembly language usually because they need to perform some function very specific to a particular microprocessor architecture. Other programs written in assembly language include programs written for very cheap microprocessors in embedded systems. Such systems have very little resources and do not run operating system and compilers. Finally some specific parts of applications programs may be written in assembly language for performance optimization, but examples of those today are quite rare indeed.

What does a computer programmer do all day or night?

A computer programmer's typical day will include checking the current list of assigned defects and enhancements, performing code changes, reviewing code changes of peer or junior developers, and perform limited tests of code that they or their team has changed. Often they will attend meetings where project goals are discussed, defects are assigned, and potential issues are addressed. Here's a specific example. When I get to work, I check my work email to see if I have any defects assigned to me. I will review these defects, and consult with the qa person who entered them, or my team lead who assigned them. I will then start either on the new defects, or continue work on the one I was on before. Once I have finished working on it, and have performed enough unit tests to give myself confidence that the code fix works, I will check the changes into our source code control system, and mark the defect as "fixed." I will then move to the next defect. Sprinkle web surfing, talking with coworkers, and general goofing off liberally to the above description.

Where online can you start to learn about computer programming and stuff like that?

There is a lot of information out on the web now. About a variety of languages. I would recommend to just jump in and start with the basics. C++ is a really easy one to start with. If you know someone in the field talk to them for advice. and of course there is always college.

How do you write a magic square program with basic?

Answer

You're better off using a program like Visual Basic or C++ to do that. QBasic doesn't have very many capabilities.


AnswerQBasic is quite capable. It is certainly capable of solving a magic squares problem.

What do you mean by modular composability in modularity in oops?

well to put it in simple way , a software construction method is modular.

A design method worthy of being called called "modular" should satisfy following five fundamentals requirements:

  • Decomposability,
  • Composability,
  • Understandability,
  • continuity,
  • Protection.

What is the use of little endian and big endian?

"Little Endian" means that the lower-order byte of the number is stored in memory at the lowest address, and the high-order byte at the highest address. For example, a 4 byte Integer

Byte3 Byte2 Byte1 Byte0

will be arranged in memory as follows:

Base Address+0 Byte0

Base Address+1 Byte1

Base Address+2 Byte2

Base Address+3 Byte3

Intel processors (those used in PC's) use "Little Endian" byte order.

"Big Endian" means that the high-order byte of the number is stored in memory at the lowest address, and the low-order byte at the highest address. The same 4 byte integer would be stored as:

Base Address+0 Byte3

Base Address+1 Byte2

Base Address+2 Byte1

Base Address+3 Byte0

Motorola processors (those used in Mac's) use "Big Endian" byte order.

Which information about a job needs to be kept in the pcb?

LOL! I think were in the same class!

information about the current status and characteristics of a process.

What does language is dynamic mean?

Computer programming languages change from generation to generation due to changes (advancements) in computer hardware. The general trend is languages are becoming more human-like as computer capabilities continue to improve.

Programming to calculate a factorial number?

double factorial(double N)

{

double total = 1;

while (N > 1)

{

total *= N;

N--;

}

return total; // We are returning the value in variable title total

//return factorial;

}

int main()

{

double myNumber = 0;

cout << "Enter the number: ";

cin >> myNumber;

cout << endl << "Factorial of N is: " << factorial(myNumber);

return 0;

}

Write a Fibonacci function then takes an input from the user in main program and pass to function which prints Fibonacci series up to this number using function in c plus plus language?

We use long int or long instead of int as for larger terms the number is also larger.

Code is as follows:

#include

#include

long fib(long n);

void main()

{

long res,n;

int i;

printf("Enter the number of terms of the Fibonacci Series:\t");

scanf("%d",&n);

for(i=0;i

{

res=fib(i);

printf("\n %d",res);

}

_getch();

}

long fib(long n)

{

long res;

if(n==0n==1)

return (n);

else

res=fib(n-1)+fib(n-2);

return(res);

}

How many pointers can be used in a c program?

Answergenerally we use simple pointer, void pointer,null pointer, structure pointer. Answerzero or more (unlimited).