Can a program be correct and still not reliable?
It depends on what you mean by the words "correct" and "reliable". A typical notion of correctness means that the program, when executed correctly, does what you want it to do. Similarly, you might want reliability to mean that every run of the program does its job.
This being accepted, it is possible for a "correct" program to prove unreliable, as when you have gamma rays hitting the memory chips and corrupting data. Such cases, while extremely rare (modern digital circuits have extraordinary ECC mechanisms), do occur in practice. An example was when a single bit error in one of Amazon's servers led to a domino crash, and within a few minutes, Amazon's S3 services were down.
Of course, the Amazon example is probably controversial, because fault tolerance is a correctness requirement for their engineers.
It is also for this reason that you'll find building ICs for rockets and satellites is a much harder job than building ICs for everyday use --- the ability to withstand high radiation without corruption being the extra requirement.
At the other end of the spectrum, you have "incorrect" programs which have nevertheless proved extremely reliable. I'm referring to the whole field of randomized algorithms. While these algorithms, strictly speaking are incorrect, they return the correct answer with high probability. Run sufficiently many times, the probability of these algorithms making is a mistake is less than the probability of your being struck by lightning. Unlike correct unreliable programs, these find use literally everywhere in the computer industry.
What are the advantages of paper based communication?
Disadvantages of paper based communication: There are many benefits towards this communication method but they always come at a cost!
Issues arise as cost of sending away Via. stamps and delivery, other areas are the writers hand writing quality along with the grammar and spelling mistakes. Some paper based methods do occasionally result in typed up letters printed off and sent away but these letters can include typo's, other mistakes, Etc. Also when you send away a letter to another destination there is always the issue of the time taken to deliver it as it can take among weeks to even months on delivery and many times, the letter is either damaged or returned which can be again a huge issue! Hope this short explanation is helpful
(I was already doing a report on this subject and thought id contribute to this WikiAnswers subject) -HiddenFang
What is the program language c?
C is a pop language.
C is a case sensetive language.
C is motherof all language.
C is block structure language.
C is a high level language.
C is advace of B language.
C developed by D.richties in 1972 at AT & T Bell lab in USA.
Sachin Bhardwaj
986854722
skbmca@gmail.com
Is it necessary to give the size of array?
Depends on the language. For C, no you don't. You can type blank brackets (int Arr[]) when declaring the array, or you can just use a pointer (int* Arr). Both will allow you to use the variable as an array without having to declare the specific size. Hope this answers your question.
In Java, an array is an object, and one which is dynamically allocated space. The default constructor does not require a size be specified.
What is mean void in c plus plus?
Void means there is no data type. So if you have a void function it does not return a value (and attempting to do so will cause an error) whereas a non-void function (ex. int, long, String, bool, etc) will return a value of that type.
What are the characteristics of object oriented systems?
the three main design principles of object oriented programming are the following:
How can we implement Leaky bucket algorithm in c?
//here is a simple implementation of leaky bucket.
#include<stdio.h>
#include<stdlib.h>
#include<dos.h>
void main()
{
int i,packets[10],content=0,newcontent,time,clk,bcktsize,oprate;
for(i=0;i<5;i++)
{
packets[i]=rand()%10;
if(packets[i]==0) --i;
}
printf("\n Enter output rate of the bucket: \n");
scanf("%d",&oprate);
printf("\n Enter Bucketsize\n");
scanf("%d",&bcktsize);
for(i=0;i<5;++i)
{
if((packets[i]+content)>bcktsize)
{
if(packets[i]>bcktsize)
printf("\n Incoming packet size %d greater than the size of the bucket\n",packets[i]);
else
printf("\n bucket size exceeded\n");
}
else
{
newcontent=packets[i];
content+=newcontent;
printf("\n Incoming Packet : %d\n",newcontent);
printf("\n Transmission left : %d\n",content);
time=rand()%10;
printf("\n Next packet will come at %d\n",time);
for(clk=0;clk<time && content>0;++clk)
{
printf("\n Left time %d",(time-clk));
sleep(1);
if(content)
{
printf("\n Transmitted\n");
if(content<oprate)
content=0;
else
content=content-oprate;
printf("\n Bytes remaining : %d\n",content);
}
else
printf("\n No packets to send\n");
}
}
}
}
What is far and near pointer and how are they used?
It is a matter of the memory model you are using. On old or embedded systems, some memory was outside of the range of a normal pointer. If you have 4 megs of ram you need at least a 22bit pointer to see all of it. But let's say you only have a 16 bit pointer. This means you can only access the first 65K of ram. Odd as it may sound, this was a problem on old computers, and is sometimes an issue on embedded devices with limited processing power. The near and far classifications were a solution. Pointers are near by default. In my example above, the 65K of ram would be accessed with a near pointer. To get past that 16 bit limit, you need a far pointer. Thus: memory within the pointer's range is near. Memory outside of the range is far. Near pointer: char near * ptr; Far pointer: char far * ptr;
A far pointer uses both the segment and the offset address to point to a location in memory. A near pointer in contrast uses only the offset address and the default segment. The far pointer can point to any location in memory, whereas the near pointer can only point to a nearby local address.
Something that was important 20 years ago. Now you can forget it.
How many operators are there in C Language?
There are several operators in the C programming language, which are used to perform various operations on variables and values.
Here is a list of some of the most commonly used operators in C:
Arithmetic operators: +, -, *, /, % (addition, subtraction, multiplication, division, modulus)
Assignment operators: =, +=, -=, *=, /=, %=, &=, |=, ^=, =
Comparison operators: ==, !=, , = (equal to, not equal to, less than, greater than, less than or equal to, greater than or equal to)
Logical operators: && (AND), || (OR), ! (NOT)
Bitwise operators: &, |, ^ (AND, OR, XOR)
Increment and decrement operators: ++ (increment), -- (decrement)
Conditional operator: ?: (ternary operator)
It's important to note that there may be some additional operators depending on the specific C compiler or implementation being used.
When using a cause-oriented approach to receive acquisition problems it is important to .?
When using a cause-oriented approach to resolve acquisition problems, it is important to
Why is assembly level language non portable?
Because machine language itself varies across systems. For example, machinecode for a x86 is totally different from machinecode for a PowerPC. This is why we need compilers and assemblers, so that the same higher level code can be translated into lower level code for various architectures.
Explain how memory is represented in a linked list data structure?
Type your answer here... Let lists be a linked. Then list will be maintained in memory unless otherwise specified or implied as follows. First of all list required two liner array we will call them here INFO and LINK such that INFO[K] and LINK[K] contain, respectively, the information part and the next pointer filed of a node of list.
As noted above list also required a variable name such as start which will contain the location of the beginning of the lists and the next pointer sentinel denoted as null which indicates the end of the lists
Since the subscripts of the array INFO and LINK will usually be positive, we will chose null otherwise started.
Which produces faster program execution a compiler or pure interpreter?
A compiled program would execute faster than an interpreter running the same code step by step.
Why return type is not considered while overloading a function?
YES only if: The return type in the child class is a sub-type of the return type of the parent class.
Ex:
public int getName() {} - Parent class method
public String getName() {} - Child class method
If we implement the above two methods in the class hierarchy we will get compilation errors. whereas if we try the below implementation it will work:
public Object getName() {} - Parent class method
public String getName() {} - Child class method
This is because String is a sub-type of Object and hence it works.
This is also called as Covariant Overriding.
Note: This feature is available only from Java 1.5. Earlier versions of Java expect overriding methods to have exactly the same return type as the super class method.
A prototype is a working example of what something will be e.g. a car or a computer system. It is designed to demonstrate to funding sources or company managers how a project to develop new products will look.
10 situations that can be represented by means of graph?
Financial history
Score history
Statistical analysis
data set averages
data set trends
time value of money
usage statistics
performance statistics
personal achievement trends
grade history and analysis
What are the ranges of basic datatype of C' programming languages?
Basic built-in data types in the C programming language are scalar types in variations of char, int and float:
char, unsigned char, signed char
int, signed int, unsigned int, short, signed and unsigned short, long, signed and unsigned long
float, double
Named enumerations are supported. These are weakly typed constant literals of type int. Bitfields are supported as range-limited signed or unsigned integers. Neither qualify as a type in their own right.
Some dialects also support additional types, such as wide character, extra large integers or floating point scalars.
The language also knows a related keyword void, which is used to express the fact that the related item has no known or no specific type. void in itself is not a type (it is rather the absence of a type).
The C programming language also supports three basic aggregates: structure, union and arrays.
Pointers can reference any of the scalar built-ins, enumerations, structures, unions, arrays, and the infamous void. Pointers are viewed as a data type by many.
Other members of the C family of languages also support class and interface types and strongly typed enumerations.
Where are boolean operators used?
Boolean operators are used in programming. It would be hard for me to explain exactly how they are used in programming without giving you a programming course, but I can tell you basically what they do. The main boolean operators are AND, OR, NOT, and XOR (exclusive or). So: * (true AND true) makes true * (true AND false) makes false * (false AND true) makes false * (false AND false) makes false * (true OR true) makes true * (true OR false) makes true * (false OR true) makes true * (false OR false) makes false * (NOT true) make false * (NOT false) makes true XOR is the same as OR except that it only allows one or the other to be true; not both: * '''(true XOR true) makes false''' * (true OR false) makes true * (false OR true) makes true * (false OR false) makes false Boolean operators can be mixed together like this: NOT (true XOR (false AND true)) makes false In programming, you often use symbols to represent these instead of writing out the words. OR is , not is !, and AND is &&. -DJ Craig They are often used by search engines. If you put in "Bob" AND "Smith" you would get results that have both Bob and Smith in them (say 150 results). If you put in "Bob" OR "Smith" you would get any result with Bob or Smith (say 3000 results). If you put in "Bob" NOT "Smith" you would get Bob Jones, but not Bob Smith. Not all search engines use these. And some use other terms for them.
The Advanced Research Projects Agency Network (ARPANET) developed by ARPA of the U.S. Department of Defense was the world's first operational packet switching network, and the progenitor of the global Internet. During the 1950s, several communications researchers realized that there was a need to allow general communication between users of various computers and communications networks. This led to research into decentralized networks, queuing theory, and packet switching. The subsequent creation of ARPANET in the United States in turn catalyzed a wave of technical developments that made it the basis for the development of the Internet. The first TCP/IP wide area network was operational in 1984 when the United States' National Science Foundation (NSF) constructed a university network backbone that would later become the NSFNet. It was then followed by the opening of the network to commercial interests in 1995. Important separate networks that have successfully entered the Internet include Usenet, Bitnet and the various commercial and educational X.25 networks such as Compuserve and JANET. The collective network gained a public face in the 1990s. In August 1991 CERN in Switzerland publicized the new World Wide Web project, two years after Tim Berners-Lee had begun creating HTML, HTTP and the first few web pages at CERN in Switzerland. In 1993 the Mosaic web browser version 1.0 was released, and by late 1994 there was growing public interest in the previously academic/technical Internet. By 1996 the word "Internet" was common public currency, but it referred almost entirely to the World Wide Web. Meanwhile, over the course of the decade, the Internet successfully accommodated the majority of previously existing public computer networks (although some networks such as FidoNet have remained separate). This growth is often attributed to the lack of central administration, which allows organic growth of the network, as well as the non-proprietary nature of the Internet protocols, which encourages vendor interoperability and prevents any one company from exerting too much control over the network. The IEEE has assigned the 802.1 label to the internetworking among 802 LANs, MANs and other wide area networks, now known as the Internet.
How is the C programming language not object-oriented?
A "pure object oriented language" is one where every thing in it is treated on a consistent basis as on object, including elementary data types such as an integer. Since C++ treats elementary objects differently than classes, it does not meet the formal definition as a "pure ...".
How much does an engineer get paid a year?
It depends what type of engineer you are. If you are a mechanical engineer and if u have experience u make around $80,000-100,000 per year.Eletrical engineers make about the same with experience. Civial engineers with experience and what type of mission their doing ,like if their making a okay sized buliding they could make around $160,000. But it depends about how much experience they have and wat type of mission their dealing with and also if their going to make a huge skyscraper like the cn tower or even bigger skyscrapers like the burj khalifa[the tallest building in the world] they could even go as high as making $100,000,000.
A source program is the program written in which language?
It is programming that is licensed in such a way that it provides the source code for everyone to view and suggest changes to, and is usually at no cost or a very lost cost to anyone that wants the program and its source code.
Can we use same compiler for both c and c plus plus language?
Yes. In fact both the C++ compiler and the linker are intrinsically command-driven; the IDE (if you have one) simply provides a graphical front-end to both. Consult your compiler/linker documentation to view the required command line syntax. In particular, consult the 'makefile' topic which should show you how to create a command file (or batch file) that can automate the entire process for a particular project.
How do you write a program to find the reverse of a given number in COBOL?
Identification Division.
Program-id. Example1.
Data Division.
Working-storage Section.
01 Num1 Pic 999 Value Zeros.
01 Num2 Pic 9 Value Zeros.
01 Num3 Pic 99 Value 10.
01 Result Pic 999 Value Zeros.
01 Temp Pic 99.
Procedure Division.
Calculator.
Display "enter First Number :".
Accept Num1.
Perform Until Num1 = 0
Divide Num1 By Num3 Giving Temp Remainder Num2
Compute Result =(result * Num3) + Num2
Compute Num1 = Num1 / Num3
End-perform
Display "result Is=", Result.
Stop Run.
What is the difference between uninitialized pointer and null pointer in c language?
A null pointer is a pointer that has been initialised with the NULL value (zero). An uninitialised pointer is one that has not be initialised to any value and will in fact store whatever value happened to reside in the pointer's own memory address at the point of instantiation. Uninitialised pointers are a clear sign of bad programming because the only safe way to determine if a pointer is valid or not is to compare its value with NULL. An uninitialised pointer will almost always be non-NULL, which means you run the risk of accessing memory that either does not belong to you, or is otherwise invalid. Most compilers include a debug switch to warn you when you attempt to access any uninitialised variable, which naturally includes pointer variables. This switch must be on at all times.
Whenever you instantiate a pointer, always initialise it straight away, either by nullifying it, or by storing a valid memory address in it. When you are finished with the pointer, it's good practice to nullify it immediately, even if the pointer would subsequently fall from scope. If the pointer is to be immediately re-assigned, there is no need to nullify it (but it's good practice nonetheless). If you follow this practice at all times, you can be assured that any non-NULL pointer will always be pointing at something valid (and if it isn't, then you have some serious problems elsewhere in your code).
As a rule of thumb, if you can use a reference rather than a pointer, use a reference. They are much easier to work with. Pointers should only be used if there's any possibility (however remote) that a reference could be NULL, because a NULL reference will completely invalidate your program (pointers can be NULL, but references can never be NULL). This is why functions such as malloc() and calloc(), and the C++ new operator all return pointers rather than references. You can only return a reference when an allocation is guaranteed to succeed, and a dynamic memory allocation simply cannot make that guarantee.