answersLogoWhite

0

📱

Computer Programming

A category for questions about computer programming and programming languages.

10,506 Questions

What does no video during POST indicate?

POST means "Power On Self Test", and is a series of tests the computer will conduct before loading your operating system (i.e. Windows). Most desktop computers that pass POST will sound a single short beep.

If POST fails with a "no video" error, that probably means the computer was unable to properly initialize the video device during POST. You will likely need your computer serviced, in this event.

Write a c program to implement Ackermann function?

#include<stdio.h>

#include<stdlib.h>

int ack(int,int);

main()

{

int m,n;

printf("Enter the value for m : ");

scanf("%d",&m);

printf("Enter the value for n : ");

scanf("%d",&n);

if(m<n)

printf("The value is : %d\n",ack(m,n));

else

printf("Evaluation is not possible");

}

int ack(int m,int n)

{

int r;

if(m==0)

r=n+1;

else if(m!=0 && n==0)

r=ack(m-1,1);

else

r=ack(m-1,ack(m,n-1));

return r;

}

Write a shell program to generate the first 25 prime numbers?

echo enter a range

read rng

echo 2

j=3

while test $j -le $rng

do

i=2

x=`expr $j - 1`

while test $i -le $x

do

if [ `expr $j % $i` -ne 0 ]

then

i=`expr $i + 1`

else

break

fi

done

if [ $i -eq $j ]

then

echo $j

fi

j=`expr $j + 1`

done

What is alpha and beta test?

Simple my fellow gamer. Beta is the beginning of a computer game and that's where beta testers come in. Beta is the root of the game and is always filled with Bugs and glitches. You will usually get rewarded if you are a beta tester.

Alpha in the other hand is the second part of the cycle which means that the game is getting better and will alow other players to play the game

The cycle: Beta → Alpha → Gamma

Alpha and Beta Testing

If software is developed as a product to be used by many customers, it is impractical to perform formal acceptance tests with each one. Most software product developers use a process called alpha beta testing to uncover errors that only the end user seems able to find.

The alpha test is conducted at the developer's site by a customer software is used in a natural setting with the developer "Looking over the shoulder" of the user and recording errors and usage problems.

Alpha tests are conducted in a controlled environment.

The beta test is conducted at one or more customer sites by the end user(s) of the software. Unlike alpha testing the developer is generally not present therefore the beta test is a "live".

The customer records all problems (real/imagined) that are encountered during beta testing and reports these to the developer at regular intervals. Because of problems reported during beta test, the software developer makes modification and then prepares for release of the software product to the entire customer base.

What is the difference between bounded loop and unbounded loop in programming?

Bounded loops are also known as counting loops because they will iterate a pre-determined number of times before terminating. For example:

for x=1 to 15

print x

next x

Here, the variable x is incremented by 1 at the end of each iteration, thus the loop execute 15 times in total.

Unbounded loops are not defined by a specific count, but by some other condition. Unbounded loops are often called infinite loops, however there must always be an exit condition that is reachable.

x = rand()

while x<>0

print x

x = rand()

end while

Here, x is set to some random value. So long as x is non-zero, its value will print and x will be set to another random value. The loop may not execute at all (if x is initially zero), but once started it is not known how many times it will iterate until the exit condition is satisfied.

What are disadvantage of algorithm?

Advantages of an Algorithm:

Effective Communication: Since the algorithm is written in English like language, it is simple to understand the step-by-step solutions of the problems.

Easy Debugging: Well-designed algorithm makes debugging easy so that we can identify a logical error in the program.

Easy and Efficient Coding: An algorithm acts as a blueprint of a program and helps during program development.

Independent of Programming Language: An algorithm is independent of programming languages and can be easily coded using any high-level language.

Disadvantages of an Algorithm:

Developing algorithms for complex problems would be time-consuming and difficult to understand.

Understanding complex logic through algorithms can be very difficult.

Why is a text editor used to write high level language?

because it would be hard to write software using a duck. ducks make terrible input devices.

What are the encryption algorithms used in ATM?

fot the past 25 years single des algorithm was used. But now triple des is used in atm cards for the encryption and decryption.

How do you write elevator program in c language?

/*This is a simple Program*/

#include <stdio.h>

#include <stdlib.h>

#include <windows.h>

#include <conio.h>

int main()

{

int curfl = 0, destfl, floor;

float high, speed;

float time1;

high = 3.0; // Height of the floor

speed = 5.0; // Speed of the elevator per second

while(1)

{

printf("Currently the elevator is at floor number = %d\n", curfl);

printf("Enter the floor number between 0-25 : ");

// printf("%d %d", &curfl, &time1);

scanf("%d", &destfl);

if(destfl > curfl)

{

floor = destfl - curfl;

time1 = (floor * (high / speed));

printf("Elevator will take %.2f second to reach %d (st, nd, rd) floor \n", time1, destfl);

while(curfl != destfl)

{

Sleep((1000 * 3) / 5);

curfl++;

printf("You are at floor number %d \n", curfl);

}

printf("Door opening \n");

Sleep(10000);

printf("Door Closed\n \n");

}

else if(destfl < curfl)

{

floor = curfl - destfl;

time1 = (floor * (high / speed));

printf("Elevator will take %.2f second to reach %d (st, nd, rd) floor \n", time1, destfl);

while(curfl != destfl)

{

Sleep((1000 * 3) / 5);

curfl--;

printf("You are at floor number %d \n", curfl);

}

printf("Door opening \n");

Sleep(10000);

printf("Door Closed\n \n");

}

else{

printf("You are the same floor. Please getout from the elevator \n");

}

}

// printf("Hello world!\n");

return 0;

}

What are the difference between interpreter and compilers?

Compilers translate the entire source code into machine code. Each translation unit (source file) is independently converted into an object file. Once all translation units have been compiled, the object files are linked together to produce an executable file. The executable file does not require any further translation and can be executed independently of the compiler. The executable is non-portable, but will execute as fast as the architecture will allow. In order to port the program to other architectures, the source code must be recompiled from scratch by a compiler intended specifically for those machines.

Interpreters translate one statement at a time and immediately execute them before moving onto the next statement. No independent executable is produced by an interpreter; the source code must be re-interpreted every time it is run. Thus the code is dependant upon the interpreter but is not machine-specific. While interpreted languages are more portable than compiled languages, execution is greatly impaired by the need to interpret the code every time it is run.

Some languages are both compiled and interpreted. Rather than producing a machine code executable, the compiler produces an intermediate byte code which can then be interpreted. Java is a typical example. The Java source code is compiled against the Java Virtual Machine (JVM) to produce portable Java byte code that can then be interpreted by any JVM implementation. Although execution is still much slower than that of machine code, the byte code is much more compact than the original source code and gives greater opportunities for optimisations that would not be possible with more traditional interpretation.

Because interpreted languages are dependant upon an interpreter, they are only suitable for writing applications software. This includes Java. Compiled languages are much less restricted. C++, for instance, can be used to write general purpose programs, including operating system kernels, device drivers, subsystems programming as well as applications software.

When was Android made?

Google purchased the initial developer of the software, Android Inc., on August 17, 2005. The unveiling of the Android distribution on November 5, 2007 was announced with the founding of the Open_Handset_Alliance, a consortium of 84 Free_software_license. The Android Open Source Project (AOSP) is tasked with the maintenance and further development of Android.

What is error 500?

Assuming you are referring to web development, a 500 error is a "server error." This can mean that a resource failed to execute, the server ran out of memory, or some other unusual (or unexpected) condition caused the page to stop executing correctly. The logs of the server will contain information about the details of the error.

How do you get real time sports data?

You would have to have a computer that receives sporting updates like scores and breaking news constantly.

How do you write c program to identify keywords using transition table?

#include

#include

#include

void keyw(char str[10])

{

if(strcmp("for",str)==0)

printf("%s is a keyword",str);

else if(strcmp("while",str)==0)

printf("%s is a keyword",str);

else if(strcmp("char",str)==0)

printf("%s is a keyword",str);

else if(strcmp("int",str)==0)

printf("%s is a keyword",str);

else if(strcmp("if",str)==0)

printf("%s is a keyword",str);

else if(strcmp("else",str)==0)

printf("%s is a keyword",str);

else

printf("%s is an identifier",str);

printf("\n");

}

main()

{

FILE *f1,*f2,*f3;

char c,str[10];

int num[100],ln=0,tvalue=0,i=0,j=0,k=0;

printf("Enter a C program expression");

f1=fopen("input.c","w");

while((c=getchar())!=EOF)

fputc(c,f1);

f1=fopen("input.c","r");

f2=fopen("identifier.txt","w");

f3=fopen("specialchars.txt","w");

while((c=fgetc(f1))!=EOF)

{

if(isdigit(c))

{

tvalue=c-'0';

c=fgetc(f1);

while(isdigit(c))

{

tvalue=tvalue*10+c-'0';

c=fgetc(f1);

}

num[i++]=tvalue;

ungetc(c,f1);

}

else if(isalpha(c))

{

fputc(c,f2);

c=fgetc(f1);

while((isdigit(c))isalpha(c)c==' 'c=='$')

{

fputc(c,f2);

c=fgetc(f1);

}

fputc(' ',f2);

ungetc(c,f1);

}

else if(c==' 'c=='\t');

else if(c=='\n')

ln++;

else

fputc(c,f3);

}

fclose(f1);

fclose(f2);

fclose(f3);

printf("Numbers in the program are \n");

for(j=0;j

printf("%d",num[j]);

printf("\n");

f2=fopen("identifier.txt","r");

k=0;

while((c=fgetc(f2))!=EOF)

{

if(c!=' ')

str[k++]=c;

else

{

str[k]='\0';

keyw(str);

k=0;

}

}

fclose(f2);

f3=fopen("specialchars.txt","r");

printf("The special chars in the pgm are \n");

while((c=fgetc(f3))!=EOF)

printf("%c",c);

printf("\n");

fclose(f3);

}

How do you get rid of a hacker?

I don't know how you're being hacked so this answer will be pretty general. 1. Simplest way is to disconnect from the Internet -- called airgapping. Hackers can't get through air. 2. Next, buy a cheap hardware firewall. They're as little as $50 (but $150) will do. Talk to the store about how to use the firewall and specifically how to shot down ports (ports are virtual "pipes" that data flows in and out of). Shut down all the ports you don't need. The firewall should stop most any intrusion. 3. Run a virus check while you're airgapped if you can -- otherwise, go out to one of the sites that will let you test your computer for malware using the most up to date tester, and see if you can find anything the hacker left behind. I'm leaving the Datafellows site, as I know they have such a program you can use. 4. Check your IE security settings and bring them up to Medium-high. Clear all cookies and Internet history. 5. Go on the offensive. Between the firewall and Windows, you should be able to see the IP of everyone connected to your system. Us the "tracert" command from the DOS (or COmmand) window to find out where he is and what ISP/carrier he's using. If you don't like tracert, get a commercial product that does this function better. 6. Call his ISP and remote the problem. 7. If it persists, call your local authorities. If they don't know, call the FBI or Secret Service. If you call the feds, be prepared to discuss WHY they should get invovled. Identity theft and/or loss of $20,000 or more are the keys to this normally.

What is the use of Bitwise operators?

Answer

The bitwise operators treat a number as its binary equivalent rather than as a simple boolean value.

For most programming languages, a value of zero is considered FALSE and all other values are TRUE

Thus, 8 AND 11 returns TRUE as does 3 OR 0

In bitwise analysis, each binary bit of the digit are compared. The number of bits compared will depend on the type of number.

In C, a CHAR is usually 8 bits and can hold the binary numbers 0 to 255.

If we compare 8 (00001000) and 19 (00010011) with bitwise operators, we get different results from Boolean operators:

8 BITWISE AND 19 returns 0 (each bit in the response is set to 1 if both equivalent bits compared are 1) but 8 BITWISE OR 19 will return 27.

The utility of these methods is in identifying binary data. For example, all files on a PC have the characteristics 'Hidden' 'Read Only' 'Archive' and 'System' which can be set or unset using bitwise operations on a single byte of data. In truth this is a throwback to the days of small memory capacities where saving the odd byte was essential.

There are more uses of bitwise, especially in graphics, where XOR can be used to paint a sprite image to display it and then be used again to return a background to its former settings. I regret I lack the skill to explain this better.

How do you calculate the LCF of two numbers using a function?

You do not need a function to determine the lowest common factor of two numbers. The lowest factor of any one number is 1. The lowest common factor of any two numbers is therefore 1 as well.

Write an algorithm to compute the circumferenc of a circle?

Step 1. StartStep 2. Input the value of radius R.

Step 3. Let PI=3.14.

Step 4. Calculate the circumference=2*PI*R.

Step 5. Display/Print the circumference.

Step 6. Stop

Can you use business logic in constructor with example in java?

No. Logic should never go in a constructor; constructors should only be used to instantiate and initialize object data.

What is the difference between deterministic finite automata and non deterministic finite automata?

A deterministic Finite Automata)DFA will have a single possible output for a given input.The answer is deterministic because you can always feel what the output will be.

A (Nondeterministic Finite Automata)NFA will have at least one input which will cause a "choice" to be made during a state transition,unlike a (deterministic Finite Automata)DFA one input can cause multiple outputs for a given (Nondeterministic Finite Automata)NFA.



Which language use in flash?

In Flash Development no need of any language. flash use for make attractive our website. we can also use applet and animation for do dat work but applet and gif animation need programing language to make so its take time to run on webpage.

dat's way we use flash. for catch out mouse and keyboard event in flash we use action script in flash.

Difference between pop and push operation in data structure through c?

Pushing means putting an item onto a stack (data structure), so that it becomes the stack's top-most item. Popping means removing the top-most item from a stack. (You often hear a third term, peeking, which means looking at/reading the top-most item.)

When it comes to queues, you should generally use the terms enqueueing and dequeueing instead, where the former means appending an item to a queue's "back end" and the latter means removing the item at the "front end" from the queue.

These definitions suggest that a stack (if you picture it in your head) is spatially vertical, while a queue is horizontal. Another difference is that operations on a stack always happen at the same end, while operations on a queue happen at opposite ends.

When it comes to linked lists and double-ended queues (deques), the terms push and pop are also used, e.g. in C++'s STL, where you have operations such as push_front, push_back, pop_front, and pop_back. These simply imply that items can be appended or removed at both ends.

Who manufactured Linux?

The Linux kernel was originally written by Linus Torvalds. It was published under the GNU GPL license, which basically allows anyone to use/modify it so long as they continue to make their changes available in source code. As such, the project grew substantially and it supported by people/companies all around the world. There are many variations/distributions made available by groups. There are some companies (Red Hat) that provide an "enterprise" quality distribution and charge for support for the platform.

So in short, there really is no "manufacturer" per say.

How do you find the largest and the smallest values among 4 numbers using conditional operators?

int a, b, c, d, max, min;

scanf("%d%d%d%d",&a, &b, &c, &d);

(a>b)?(max=a,min=b):(max=b,min=a);

(c>d)?(a=c,b=d):(a=d,b=c);

max=(a>max)?a:max;

min=(b<min)?b:min;

printf("%d %d\n", max, min);