answersLogoWhite

0

📱

Computer Programming

A category for questions about computer programming and programming languages.

10,506 Questions

What is seventeen twentieths as a decimal?

Expressed as a decimal, 17/20 is equal to 0.85.
85% or 0.85

Is the array size is fixed after it is created?

Generally, a array is fixed in size. With some libraries, however, they are extensible, either by reallocation/copying strategies (C/C++/STL), or by linking/referencing strategies (JAVA).

What is a variable that is used within a function?

If the variable is declared within the function body, it is a local variable, one that is local to the function. Local variables fall from scope when the function returns, they are only accessible within the function. However, local variables can be returned by value, which creates an automatic variable that is returned to the caller. If the caller does not store the return value, the automatic variable falls from scope when the expression containing the function call ends. However, the expression may evaluate the return value without storing it. Note that functions cannot return local variables by reference since the local variable falls from scope when the function returns.

If the variable is passed as an argument to the function, then the variable is a parameter of the function. Arguments may be passed by value or by reference, depending upon the function signature. Passing by value means the function parameter is a copy of the argument (if the argument is an object, the object's copy constructor is invoked automatically). Thus any changes made to the parameter within the function are not reflected in the argument that was originally passed, and the parameter will fall from scope when the function returns. However, the value of the parameter can be returned as previously explained.

Passing by reference means the function parameter refers directly to the argument that was passed. Thus any changes made to the parameter are reflected in the argument.

Parameters that are declared as constant references assure the caller that the reference's immutable members will not be altered by the function. If the parameter is a non-const reference but the caller does not wish changes to be reflected in the argument, the caller should pass a copy of the argument instead.

How many hours of course study is a masters degree in information technology?

A masters within this field of study - in total - can range between 33-40 credit hours depending on the specific college or university curriculum layout. It usually takes a student two to three years to complete depending on the credit load carried each semester, personal work/life responsibilities, and/or whether it is taken as an accelerated program (which some institutions offer).

In a computer most processing takes place in?

This answer would be the CPU (Central Processing Unit).

Program in java to add two numbers?

import javax.swing.JOptionPane;

public class Addition

{

public static void main( String args[] )

{

String firstNumber =

JOptionPane.showInputDialog( "Enter first integer" );

String secondNumber =

JOptionPane.showInputDialog( "Enter second integer" );

int number1 = Integer.parseInt( firstNumber );

int number2 = Integer.parseInt( secondNumber );

int sum = number1 + number2;

JOptionPane.showMessageDialog( null, "The sum is " + sum,

"Sum of Two Integers", JOptionPane.PLAIN_MESSAGE );

}

}

Write a program of using recursion to create a table of any number?

/*mycfiles.wordpress.com

Program to prepare Table of any no. using while loop*/

#include

#include

void main()

{

int n,t,count=1;

clrscr();

printf("Enter any number\n\n");

scanf("%d",&n);

while(count<=10)

{

t=n*count;

printf("\n%d*%d=%d",n,count,t);

count++;

}

getch();

}

Difference between C and C Plus programming languages?

C++ allows you to mix object oriented programming with generic programming and C-style programming. C has none of these features.

C-style programming and C programming are broadly similar, with only minor differences, most of which are irrelevant. As such, it is very rarely necessary to use a lower-level language than C++.

The static type system in C is inherently weak; filled with loopholes and inconsistencies. C++ is much more robust by comparison.

What best explains the difference between a local and a global revision?

A local revision focuses on word choice and language; a global revision addresses organization and other larger elements.

C program to accept a string and search a character?

#include<stdio.h>

#include<conio.h>

int main()

{

char str[20],charsrc;

int i,j=0,re;

printf("Enter the string\n");

gets(str);

printf("Enter the character to be searched : ");

charsrc=getche();

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

{

if(charsrc==str[i])

{

re=i;

j=1;

}

}

if(j==1)

printf("Character is at position %d",re);

else

printf("Not found.");

return 0;

}

Why do global variables make a program difficult to debug?

The term variables imply that those things may be changed or assigned with new value (at numerous places). This make the program harder to debug because it will be difficult to know when and where a global variable being changed and what was the consequence of that value changed.

What is the input statement for a program?

Input statements extract data from an input stream. For example:

int x;

std::cin >> x;

Output statements insert data to an output stream. For example:

std::cout << x;

You cannot insert data into an input stream and cannot extract data from an output stream. However, streams that are both input and output streams (such as read-write files) can insert and extract data as required, depending on whether you are reading or writing to the stream.

Difference between simple queue and circular queue?

Simple queue is a linear queue having front & rear var to insert & delete elements from the list.But there is a boundary that we have to insert at rear & have delete from front.For this reason instead of having space in the queue if there is a single element in the rear,the queue is full.the other space is wasted.
To utilize space properly,circular queue is derived.In this queue the elements are inserted in circular manner.So that no space is wasted at all.

What is the difference between profiling and debugging?

Profiling is about executing a program and finding out how much time it spends in each routine. The goal of profiling is often finding slow routines in a program and optimizing them. Profiling is done on working code.

Debugging is about finding code that is not working, i.e. has some kind of defect. The program is known to have a defect because some set of inputs causes a set of outputs that are known to be wrong. Debugging is the process of finding the source of the defect in the code and fixing that location and any other downstream locations so that the set of inputs is correctly rendered into the set of outputs.

How important is Syntax in Excel?

Syntax is very important when writing Excel formulas. Each formula and function will help guide you through how to format the equation. Probably the most important thing to remember about syntax is to begin all formulas with the equal sign, or Excel will just interpret your entry as text and not calculate anything.

EXAMPLE: =SUM(A1:A12) [Adds the contents of cells A1 through A2]

Why do compiler writers need formal grammars?

Just as a person requires knowledge of the syntax (structure) and semantics (meaning) of a spoken language, so too does the compiler need to "understand" how to interpret what is being given to it. A formal grammar provides the rules of syntax and semantics.

Do can connect database with javascript?

You can't connect directly from a browser to the database, as the browser doesn't have access.
Even if you could, you shouldn't: If your Javascript sends SQL statements to the database, there is nothing stopping a random visitor from having fun by changing your SQL to "drop table", and your entire database is gone.

What you do is setting up a server side web service (using PHP, Java servlets, Ruby on Rails or whatever) that accepts a URL, converts it to a DB query and returns the result as JSON. The primary thing from a security standpoint is that you never insert a string from the web into the SQL without validating it first.

As an example, you could have something like this:

--- browser javascript (using jQuery) ---
$.getJSON("/productDetail.json?productId=123", function (data) {
// do something with the data
});

--- server (using Java servlet) ---
void doProductDetail(HttpServletRequest req, HttpServletResponse res) {
int productId = Integer.parseInt(...); // get product ID from query param
String sql = ...; // generate the SQL
String json = ...; // execute query, convert result to JSON
res.write(json); // send to browser
}

Write a python program to check a number is Armstrong number?

Unless someone is willing to write an entire program for you (which I would, but I don't have the patience to learn an entire new programming language to answer one question) I think the best you'll get is this:

  • To get user input: var = raw_input("Enter something: ")
  • To separate a number into its single digits: var = "your number"

    var2 = list(var) var2 will have what seems to be an array of each number.

  • foreach loops in Python are just: for "item" invar2: # do something with item such as cube it and add it to another variable set aside for the overall value. Or cube it and subtract it from the original and at the end check if what used to be the original is now zero.
  • Lastly, if it's in quotes you can change it.

Another way to do it (which would be easier but would probably take slightly longer and has a limit of number 10 digits or less) would be to check to see if the number is in the list in the related link.

I've been curious about Python before so if I end up getting to the point that I can write a simple program in it I'll add it to the related links.

How many vertices does an Triangle have?

A triangle has three sides and therefore three vertices, or angles.

Algorithm for implementing push operation on stack?

1. If TOP = MAXSTK THEN [Stack already filled?]

Print "OVERFLOW"

Go to step 4

Endif

2. TOP = TOP + 1 [Increase TOP by 1]

3. Set ST[STOP] = ITEM [Insert ITEM in new TOP position]

4. End

Write a program to print all the ASCII values and their equivalent characters using a while loop?

#include<stdio.h>

#include<conio.h>

void main()

{

int a=1;

while(a<=255)

{

printf("%d=%c",a,a );

a++;

}

getch();

}

Why you Use Memory Segmentation In 8086 Microprocessor?

The 8086/8088 is a 16 bit processor running on a 16 bit (8086) or 8 bit (8088) bus with a 20 bit address bus. In order to obtain the extra 4 bits of addressibility, Intel designed segment registers that are effectively multiplied by four and then added to the 16 bit offset address generated by the instruction. This yields 64K segments of 64KB each, although they overlap each other at a distance of 16 bytes.