answersLogoWhite

0

📱

Computer Programming

A category for questions about computer programming and programming languages.

10,506 Questions

How would we write a program that calculates the area of a circle and displays the result?

The area of a circle is calculated as πd^2, where π is the constant ratio between the diameter of a circle and its circumference, d is the diameter of the circle and ^2 is the square of their product.

In programming languages where the value of π is not built-in, we must define it. To ensure the maximum possible precision across all implementations of the language, π is typically expressed as arctan (1) * 4.

In C programming, we'd define this constant as follows:

const double PI = atan(1.0) * 4.0; // global constant: e.g., 3.14159265359...

From this we can implement a function to compute the area of a circle:

double area_of_circle (double diameter) { return pow (PI * diameter, 2); }

Note that the atan() and pow() functions are both defined in the C standard library header or in if using C++.

What is the function of calibration software?

Calibrated Software develops applications and plug-ins for video, asset management, and mobile workflows. Tools from Calibrated Software are used across the professional media creation market to help customers open up new post-production workflows and navigate the evolving landscape of today's digital camera and file format technologies

Can an application or devce driver specify if it will use physical memory or the swap file for its data?

No, because the O/S call to allocate memory can allocate either physical memory OR swap file space. It's under O/S control, not the application.

What is a standoff in computer terms?

In computer terms, a standoff is a separator that is threaded and used to raise an assembly above another. Generally, their construction is round or hex shaped. Usually made of brass, nylon or aluminum, they come in female - female or male - male forms.

What is the lowest level language with instructions coded in binary notation?

Machine code. Writing machine code is known as "banging the metal". Assembler language makes producing machine code that much easier using a symbolic language, and is therefore low-level. All other languages are high-level and greatly simplify the production of machine code.

Program to find the factorial of a number using recursion?

/*program to find the factorial of a given number*/

#include<stdio.h>

#include<conio.h>

int fact(int);

void main()

{

int n,c;

printf("\n enter the number for which you want to find the factorial");

scanf("%d",&n);

c=fact(n);

printf("\n the factorial of the number %d is %d",n,fact);

getch();

}

int fact(int n)

{

int k;

if(n==0)

return(1);

else

k=n*fact(n-1);

return(k);

}

HOW TO SOLVE 'C' problem?

1.

write a 'c' program to read 4(four)numbers from a file 'BANK' and calculate the average of the numbers.Now print the calculated average in another output file 'AVERAGE'

2.

write a 'c' program that finds the sum and average of inputted five integer numbers of the array using dynamic memory allocation function malloc().

3.

write a 'c' program to create simple elements 1,2,3,4 in the link list of 4(four)nodes and display the list's elements.

4.

write a 'c' program to convert the expression (A+B)/(C+D) into postfix expression into stack.and then evaluate it for A=10,B=20,C=15,D=5 and display the stack status after each operation.

5.

write a 'c' programto create a linked list implemented on an array containing the following numbers:1,2,3,3,3,4,4,9

and pack it to remove the duplicate numbers.so that only the following data are contained by the nodes:1,2,3,4,9

Processing is a programming language that was developed for what purpose?

The purpose of processing is to teach the basics of programming in a visual manner. It is also used as a "virtual sketchbook" of sorts.

Deifference between declaration and definition?

Declaring a variable or function reserves an entry in a symbol table for that function or variable (entries in a symbol table eventually become memory addresses during linkage). Defining a variable or function actually specifies the value to be stored in the memory location specified and/or the code that should be compiled. Examples:

Declaration:

int foo(); // Declares a function.

int bar; // Declares a variable.

Definition:

int foo() {

printf("Hello World");

}

bar = 5;

Declaration and definition:

int bar = 5;

30 examples of variables?

int n1;

int n2;

int n3;

int n4;

int n5;

int n6;

int n7;

int n8;

int n9;

int n10;

int n11;

int n12;

int n13;

int n14;

int n15;

int n16;

int n17;

int n18;

int n19;

int n20;

int n21;

int n22;

int n23;

int n24;

int n25;

int n26;

int n27;

int n28;

int n29;

int n30;

How do you program C programming language in a device?

You need to get an SDK for the device you are planning to program for, SDK also lets you run your program on PC in an emulator. Once written you can then compile the program for device which would generate an installer package that you can then install on the device.

What Errors are relatively easy to locate and correct because the compiler or interpreter you use highlights every error?

Run time errors or syntax errors are most easy to locate, since the compiler will show you where the errors are. A logic error would be more difficult to locate, since the program runs but does not compute the desired result.

What are the advantages of using base 10 for people?

Some advantages of uisng base 10 for people are that for a number like 57, you can just say 57 instead of 111001. Also, humans have 10 finger to count on.=P

What are the features of algorithm?

An algorithm is just a description of a series of steps used to solve a specific problem.

What is xml format?

XML stands for "eXtensable Markup Language." It is a method of marking information with tags very similar to HTML. By marking data with these tags, you can easily programatically parse data. Example: John 20 Male Sue 35 Female

Which command would you use to run a Fortran code?

Fortran is a programming language, which means you write a program in Fortran, and COMPILE it to an EXECUTABLE program. The compiler you use differs depending on which operating system platform you intend to run the program on. If you wish to run the program on a PC using Windows XP, you must first compile it using a specific Fortran-compiler for Windows XP. The result after compiling will be an executable file (with the file-ending .exe). To find a suitable compiler, check out download.com, for instance.

Given that you know it is Fortran Code, we can assume that you do not have a compiled one, but just raw Frotran Source code.

To compile it, you need a Fortan compiler suitable for both your operating system as well as the version of Fortran the code was written for.

There is a free Fortran Compiler for Fortran77 from the GNU Project:

For Windows: http://www.geocities.com/Athens/Olympus/5564/

For Unix: http://www.gnu.org/software/fortran/fortran.HTML

The above is correct assuming your question is "Given the Fortran source code, how do I run it?" However if your question is "Given the Fortran executable (ProgName.exe) how do I run it?", the is that you run it like any other program. You either: 1 - Double-click on the file name OR 2 - Open a DOS window, go to the directory where the file is and type in the filename with or without the extension .exe OR 3 - You can select Start and Run and type in the filename.

Like any "compilable" language it can be used to build an exe or a dll. But a dll MUST be called by another program to run, you can only run a .exe directly.

------------------

In addition the workflow for running a Fortran program on a *nix platform (such as Unix, Linux, or Mac OSx) would be as such:

1) Write given Fortran code with proper extension

a) Fortran 77 - *.fb) Fortran 90 - *.f90c) Fortran 95 - *.f95

2) Compile using your compiler suite (showing examples for a few different cases)

a) for gfortran as mentioned abovegfortran myfile.f90 -o myExecutableg77 myfile.f77 -o myExecutableb) for OpenMPImpif90 myfile.f90 -o myExecutablempif77 myfile.f77 -o myExecutablec) for Intel Fortranifort myfile.f90 -o myExecutable

3) To run the executable first make sure it is marked as executable, this can by going to the folder in which it was compiled then typing:

ls -l

You will then see the myExecutable file marked with permissions. Check to see if the executable permission is there. If it is not, you must change permissions to allow it to be executed. This is done by typing:

chmod a+x myExecutable

4) Finally to actually run the code you simple add the execution prefix:

./myExecutable

This will cause the file to run with output in the current terminal session. Note that if you terminate the terminal/ssh session, the code execution will halt. If you want to execute a large piece of code on lets say a remote computer (or a cluster for scientific computing) then you do the following step instead of 4

4*) To run the executable in backround and log terminal output (if you don't want to keep the terminal window open) you use the following command:

nohup ./myExecutable > terminalOuput.txt &

This will cause the executable to run in the background, it will the tell terminal not to hang up (nohup) if you close the window, and it will append the terminal output to the file terminalOutput.txt

My son has a computer but I cant get on it to put a keylogger on it and I fear he is on bad websites.Is there any possible way to send one to his computer?

You're the parent. Take control of the situation and if necessary, remove the computer until you have unrestricted access. If necessary, take the box to a specialist and have filters and a keylogger installed.

What is the maximum combined length of command line arguments including the space between adjacent arguments?

So for as i know, it depends on the first argument which represents the number of arguments. If argc is 2 bytes in length, 65535 strings can be passed. If argc is 4 bytes in length, 4294967295 strings can be passed. In Both the cases first one is for program name. And the total length should not exceed the heap size.

S.Sunil kumar,MCA(2008-2011) from CEG, Anna University

Answer: OS dependent, for example in DOS only 127

Can you delete the head node from doubly linked list?

If by 'head node' you simply mean the first node, then yes; but if 'head node' means the special element which is not supposed to ever be deleted (aka sentinel node), then no.