Here is that kind of script:
#!bin/bash
# Checking parameters number, we need two parameters
if [ $# -ne 1 ]
then
echo "Wrong number of parameters, please try again."
exit 1
fi
# Checking if number is odd or even
if [ $[$1 % 2] -eq 0 ]
then
echo "Even"
# Write number to even.txt file
echo $1 >> even.txt
else
echo "Odd"
# Write number to odd.txt file
echo $1 >> odd.txt
fi
exit 0
This bash script accepts one parameter - number and if number is even it is written into end of even.txt file and if odd into odd.txt.
Is every subset of a finite set is a finite?
prove that every subset of a finite set is a finite set?
What is the Difference between assembler and macro?
I am not sure about the answer but think so,
Assembler: Its a program that converts a low level language into machine code, and there is a one-to-one correspondence between the source language statements and machine instructions
Macro- Assembler: It performs the same task as does the assembler but there is some times a one-to-many correspondence between the source language statements and machine instructions.
Please discuss further...
What are register variables What are the advantage of using register variables?
Asks the compiler to devote a processor register to this variable in order to speed the program's execution. The compiler may not comply and the variable looses it contents and identity when the function it which it is defined terminates.
How do you Launch INF File from a batch file?
I would suggest typing in: start <nameofthefile>.INF and make sure that you have a program that is set up to defaultly open INF files.
What is the total number of spanning tree that can be drawn using five labeled vertices?
125 according to Cayley's formula for counting spanning trees.
For a complete graph Kn,
t(kn) = nn-2
where n is the number of vertices.
How do you reair currapt harddisk?
Well, you can try running chkdsk, a DOS program included on all versions of Windows. Open up a command prompt window, called cmd.exe. Type that in a run box, and a black-and-white window will open.
There will be text that says C:\Users\you> or something like that, if on a Vista computer, or C:\Documents and settings\you> if on XP.
Type:
chkdsk /f
This starts the chkdsk program, and the /f is a switch meaning to fix any errors.
If that doesn't work, then it might not be easy to fix.
You could try looking for data recovery software using a search engine such as Google or Yahoo.
But I don't know how well any of these steps will work.
How do you print the series of prime number between 11 to 100?
#include<iostream>
bool is_prime (const unsigned num) {
return num%2 && num%3 && num%5 && num%7;
}
int main() {
for (unsigned num=11; num<=100; ++num)
if (is_prime (num))
std::cout<<num<<std::endl;
}
Output:
13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97
What is passing by address in C code?
When you pass in a memory address (ie. pointer) into a function rather than passing in the value itself.
Which command is used to pause the execution of the script for a specified amount of time?
You need to be more specific. There are dozens (hundreds?) of scripting languages out there.
What are the problems that can occur if you do not implement locking properly?
The main - and most important - problem that can come from buggy locking code is that the data you're trying to establish a lock on may end up being accessed and edited by multiple threads/processes at the same time. This would, of course, defeat the purpose of trying to lock out data.
Other problems could include things like two threads trying to access some data at the same time, but each thinks the other has a lock on it. Which would give us a nice little deadlock to deal with.
How do you get coins on whirled?
To obtain coins in Whirled, you must either play games that give out coins and sell items in the shop.
Semaphores are a useful tool for mutual exclusion, but they are not the only such tool provided by the kernel. Instead, most locking is implemented with a mechanism called a spinlock. Unlike semaphores, spinlocks may be used in code that cannot sleep, such as interrupt handlers. When properly used, spinlocks offer higher performance than semaphores in general. They do, however, bring a different set of constraints on their use.
On facebook how can you make YoVille full screen?
you cant, but you can reduce the monitors resolution this will make the image bigger. If your using a 4:3 aspect ratio monitor try setting it to 800 x 600 it fits nicely in the screen at that. If you have lots of those silly tool bars installed you might want to hit F11 key to full screen the browser.
Why is it important to check the return status when opening a file in c plus plus?
The return value tells you if any errors occurred. A value of 0 typically indicates no error.
What program should you use for code writing?
This question is too vague to be answered completely, but the general answer is "the program you're most comfortable working in." Most languages have an editor that someone built for the purpose of that language, and many general-purpose editors also exist. The best program for any given task is one that maximizes your productivity. For C++ or Java, you might use Eclipse, for example, or you might use the IDE for your version of C++, or you might use NetBeans for Java. There really isn't one best answer for this question.
Most popular software development kit?
This entirely depends on what you are trying to build, but here are some suggestions on what to include:
Since this is listed under Windows, I would say Microsoft Visual Studio.
For Java or Linux development, use Eclipse.
For XML/XSLT, use oXygen and RenderX.
For PHP, use Zend Studio with XAMPP.
Other options:
Delphi (Pascal)
Dreamweaver (HTML)
I usually combine this with a set of image editors (Photoshop, Illustrator, GIMP, Fireworks)
and some quick editors (Notepad++)
I think the ultimate development kit should contain a lot of this kind of tools. Hope it helps.
What is linear programming used for?
Linear Programming is used for determining a way to find the best solution or outcome for a given mathematical model represented as a linear relationship.
A triangle contains three sides (and thus also three angles).