What is the Difference between Peterson's algorithm and Dekker's algorithm?
Dekker algorithm has much more complex code with higher efficiency, while Peterson has simpler code. Imran
Dekker algorithm has also the disadvantage of being not expendable (maximum 2 processes mutual exclusion, while Peterson can be extended for more then 2 processes.
more info here:
http://en.wikipedia.org/wiki/Peterson%27s_algorithm#The_Algorithm_for_more_then_2_processes
An indenting business is a company that earns commissions on sales without buying or reselling anything. Some examples include businesses that specialize in technical support, distribution, shipping, importing or exporting, marketing, etc.
What is strong number n Armstrong number in C language?
Strong number:-
The sum of the factorials of digits of a number is equal to the original number.
Ex: n=145=> 1! + 4! + 5! = 1 + 24 + 120 = 145
so it is strong number.
Armstrong number:-
The sum of the cubes of digits of a number is equal to the original number.
Ex: n=153 => 13 + 53 +33 = 1+125+27= 153
so 153 is arm strong number.
C program for strong numbers
#include
#include
void main()
{
int sof=0,n,dn,ctr,prod,rem;
printf("Enter the number\n");
scanf("%d",&n);
dn=n;
while(n!=0)
{
prod=1,ctr=1;
rem=n%10;
while(ctr<=rem)
{
prod=prod*ctr;
ctr=ctr+1;
}
sof=sof+prod;
n=n/10;
}
if(sof==dn)
{
printf("The number entered is strong number");
}
else
{
printf("The number entered is not a strong number");
}
}
C program for amstrong numbers
#include
#include
void main()
{
int dn,rem,sum,n;
printf("Enter the number:");
scanf("%d",&n);
for(dn=n,sum=0;n!=0;rem=n%10,sum=sum+rem*rem*rem,n=n/10);
if(dn==sum)
printf("Amstrong number");
else
printf("Not a amstrong number");
}
By Nagarjuna ECE
sri indu,
IBP
GOT MILK GOT MILK GOT MILK GOT MILK GOT MILK GOT MILK GOT MILK 7 digits in a phone number
Solution of compilers principles techniques and tools?
Describe the languages denoted by the following regular expressions:
a) a(a|b)*a.
b) ((e|a)b*)*.
c) (a|b)*a(a|b)(a|b).
d) a*ba*ba*ba*.
!! e) (aa|bb)*((ab|ba)(aa|bb)*(ab|ba)(aa|bb)*)*.
Difference between program counter and instruction pointer?
There isn't any difference. Two different words forexactly same thing. Third way to call it is instruction address register.
What is the difference between a bi pap and a c pap machine?
the bi pap has oxygen added to the air where as the c pap has just compressed room air I am very sorry to have to do this, but the above answer is incorrect. I am fully aware of the function of bi-pap and c-pap systems, as I live with one every night, and have researched the technologies in depth. A c-pap machine provides a constant air pressure to the mask of the wearer, whether they are breathing in or out. A bi-pap machine provides one pressure on inhale (higher pressure) and another (lower pressure) on exhale. Either of these machines can be used with or without oxygen added. Likewise, either machine can be run with added humitity. A c-pap machine is more difficult to get used to than a b-ipap macchine, since you are exhaling against a greater pressure with a c-pap unit. A bi-pap unit senses your breathing, and reduces its pressure as soon as you start exhaling. I use a bi-pap machine, and it is very comfortable to use. I have never been able to get used to a c-pap machine; I can't exhale against the pressure. The main reason why everyone doesn't use a bi-pap machine is the cost - thousands of dollars for a bi-pap machine versus hundreds of dollars for a c-pap machine.
What is Code segment in C program?
A code segment, also known as the text segment holds all the executable instructions of the process. The text segment usually starts from the lowest address space of the process memory (leaving behind a small unmapped memory ..not mapped to a physical memory)
--Vivek Purushotham
(vivek.purushotham@gmail.com)
How will you select the test case for regression testing?
The selection of test cases for regression testing:
A program which convert English language to Assamese language in c program?
No. There is not any program or software.
B'coz language is such a vast thing.
It needs lots of efforts and knowledge about d specific language.
Translator by Google is provided for some famous languages only.
What are the most common syntax errors in LISP programs?
Incorrect placement or number of parentheses will probably make the most common syntax error in LISP programs.
What is the Difference between data buffering and busing structures?
data buffering is the method to smooth the traffic flow or to control the bottle neck. it reduce the speed gap between memory access for instruction or data fetch or execution in instructional pipeline.
whereas, in pipelines sometime one instruction depends on other, and which sometimes causes conjection and bottle neck problem, so control this problem we use busing structure
C plus plus and java are examples of what languages?
They are not examples of languages. They arelanguages.
What is Difference between local variable and data members or instance variable?
A data member belongs to an object of a class whereas local variable belongs to its current scope. A local variable is declared within the body of a function and can be used only from the point at which it is declared to the immediately following closing brace. A data member is declared in a class definition, but not in the body of any of the class member functions. Data members are accessible to all member function of the class.
Difference between pointer to constant and constant pointer?
1. pointer to a constant means you can not change what the pointer points to
2. constant pointer means you can not change the pointer.
When the printf function is called it always begins printing at the beginning of a new line?
Of course not.
Write a C program to accept 10 numbers and find the sum and average?
#include
using namespace std;
int main()
{
int numberOfElemenets = 10;
double myArray[numberOfElements] = {0.0};
double sum = 0;
for (int index = 0; index < numberOfElements; index++)
{
cout << "Enter " << (index + 1) << " number: ";
cin >> myArray[index];
}
for (int index = 0; index { sum += myArray[index]; } cout << "\nSum of all elements: " << sum << endl; cout << "Avarage is: " << (sum/numberOfElements) << endl; return 0; }
Difference between array processor and multiprocessor?
an array processor can handle multiple data elements simultaneously,in a parallel fashion, but a multiprocessor handle multiple processes simultaneously which may include more than one data element in each process...
An array procesor is optimized for array operations, has its own set of instructions, large memory block moves, logical operations on many array elements, etc and may itself be multi-processor or massively parallel. It has an interface where a host loads memory locations with the array to be processed (or perhaps a data file), then the array processor uses its specialized structure to do what was asked of it on the array, then tell the host is done and the result may be found in memory locations or perhaps a data file. Many of the jobs supercomputers do are array operations, the specialized capabilities can cost thousands of dollar per CPU second but they can do array operations that might take years for slower general purpose computers.
An array procesor can also be smaller, a graphics processor handling the video display is an array processor.
A typical operation is move the image to the right, move all the pixels to the right..
A general purpose computer may be multi-processor (Intel's multi-core).
Functional OPR
2 types of identifiers in C programming language?
1. identifiers beginning with a letter
2. identifiers beginning with an underscore
How to program set Cardinality in C plus plus?
The cardinality of a set is simply the number of elements in the set. If the set is represented by an STL sequence container (such as std::array, std::vector, std::list or std::set), then the container's size() member function will return the cardinality.
For example:
std::vector<int> set {2,3,5,7,11,13};
size_t cardinality = set.size();
assert (cardinality == 6);
What data type is a percentage?
Percentage is not a data type. A percentage of something would need a floating point data type to store it. One of the following data types.
float
double
long double (in gcc, not sure about other compiler systems)
What are the importances of linked list and its real-world application?
Outside of academia I do not think linked list are important, a btree is important.
As for a real-world application, I do not recall one. I did use a linked list back in the days of the Apple 2/Commodore 64 but That was before hard drives (were affordable) and before I got my hands on btree source code.