What are the numerical method of gauss elimination and gauss Jordan method?
Here is the program for Gauss elimination method
#include<iostream.h>
#include<conio.h>
#include<math.h>
void main()
{float a[6][6],b[6],x[6],t,s;
int i,j,n,k;
clrscr();
cout<<"Enter the maximum no. of matrix"<<endl;
cin>>n;
cout<<"Enter th elements of matrix"<<endl;
for(i=0;i<n;i++)
{
for(j=0;j<n;j++)
{
cin>>a[i][j];
}
}
cout<<"enter the right constant"<<endl;
for(i=0;i<n;i++)
{
cin>>b[i];
}
for(k=0;k<n-1;k++)
{
for(i=k+1;i<n;i++)
{
t=a[i][k]/a[k][k];
a[i][k]=0;
for(j=k;j<n;j++)
{
a[i][j]=a[i][j]-(t*a[k][i]);
}
b[i]=b[i]-(t*b[k]);
}
}
x[n-1]=b[n-1]/a[n-1][n-1];
for(i=n-1;i>=0;i--)
{
s=0;
for(j=i+1;j<n;j++)
{s=s+(a[i][j]*x[j]);
}
x[i]=(b[i]-s)/a[i][i];
}
cout<<"the solution is"<<endl;
for(i=0;i<n;i++)
{
cout<<"x["<<i<<"]="<<x[i]<<endl;
}
getch();
}
C program for Gauss Jordan method:
#include<iostream.h>
#include<conio.h>
#include<math.h>
void main()
{float a[6][6],b[6],x[6],t,s;
int i,j,n,k;
clrscr();
cout<<"Enter the maximum no. of matrix"<<endl;
cin>>n;
cout<<"Enter th elements of matrix"<<endl;
for(i=0;i<n;i++)
{
for(j=0;j<n;j++)
{
cin>>a[i][j];
}
}
cout<<"enter the right constant"<<endl;
for(i=0;i<n;i++)
{
cin>>a[i][n];
}
for(k=0;k<n;k++)
{
for(i=0;i<n;i++)
if(i!=k)
{
for(j=k+1;j<n+1;j++)
{
a[i][j]=a[i][j]-(a[i][k]/a[k][k])*a[k][j]);
cout<<"the solution is"<<endl;
for(i=0;i<n;i++)
{
x[i]=(a[i][n]/a[i][i]);
cout<<"x["<<i<<"]="<<x[i]<<endl;
}
getch();
}
Which type of conferencing is preferred for high level security sensitive negotiations?
Face- to- face
What are five advantages to using case structure to program multiple alternative decisions?
1. Switch/case structures yield cleaner, more maintainable code than equivalent nested if..else statements.
2. With if...else statements, the programmer must put the most likely cases first. With switch/case structure, the order of the cases is immaterial.
3. The default switch/case label can be placed anywhere. With if...else, the default must be placed last.
4. Where multiple cases contains common (duplicate) code, omitting the break statement allows execution to fall through to the common code. With if...else, the common code must be duplicated.
5. Switch/case is as fast if not faster than equivalent nested if...else statements. However, modern compilers can optimise nested if...else statements into an equivalent switch/case structure wherever appropriate, thus the speed advantage is much less of a concern these days.
Whenever you have the option of using one or the other, use switch/case if only to make code more readable. However, there will be cases where an if...else may be more readable. For instance, consider the following examples:
void f (const char c) {
if (c>='a' && c<='z') {}
else if (c>='A' && c<='Z') {}
else if (c>='0' && c<='9') {}
else {}
}
void g (const char c) {
switch (c) {
case 'a': case 'b': ... case 'y': case 'z': {} break;
case 'A': case 'B': ... case 'Y': case 'Z': {} break;
case '0': case '1': ... case '8': case '9': {} break;
default: {}
}
}
Typing out all the cases in function g would obviously be tiresome and error prone compared to the succinct statements of function f. However, a good compiler will generate the same code regardless of which function you use, so the choice is simply one of which is the most readable.
Which command is used for searching a file for one or more designed character?
put a star sign for search like a* or a*.txt or a*.doc or a*.pdf etc
*.doc etc or a*.* will search all file names starting with a
What means the operating system automatically configures new devices as you install them?
Plug and Play - for those studying in a college level introductory to computers.
I know this question is arguable (as most of them are) but the people that provide who created this "college level material," are probably more concerned about profit rather than educational ethics.
What is the language created by Augusta lovelace?
The computer language, ADA, was commissioned in 1979 by the United States Department of Defense. It was named after Augusta Ada Lovelace because she is considered the first computer programer. ADA is a general-purpose language designed to be readable and easily maintained. It is efficient for machines, yet easy to use.
Who is lady Augusta Ada Byron?
Lady Augusta Ada Byron, also called as Ada Lovelace, was an English mathematician. She was also a writer. She is often called as the first computer programmer who contributed to Charles Babbage's early mechanical general-purpose computer and the Analytical Engine. The first algorithm was written by her on engine to be performed by a machine.
What is meant by algorithm profiling?
In recent years, several very efficient exact optimization algorithms have
been developed in the computer science community. Examples are maximum flow
algorithms, minimum-cost flow techniques, matching methods, which all are graph
theoretical approaches or sophisticated branch-and-cut methods, originating in
the field of linear optimization. These algorithms have now been applied to
problems from physics like for random magnetic materials (random-field systems,
spin glasses), in surface physics (solid-on-solid models) and many other
disordered systems. The system sizes which can be treated are now much larger
than ten years before, allowing the obtain now more reliable and higher
significant data.
An information system generally consists of people procedures h and s?
A: People, Procedures, Hardware & Software
7 Write a C program to compute the factorial of a number using for loop?
int factorial(int n) {
int i;
int f=1;
for(i=2;i<=n;++i) f*=i;
return f;
}
What are the advantages and disadvantages of employing the using directive?
The using-directive is often confused with a using-declaration. A using-declaration adds a given name to a local scope whereas a using-directive does not; it simply makes names accessible in the scope in which they were declared. For example:
namespace X { int i=0, j=0, k=0; }
int k=42; // global scope
// using-directive example:
void f1 (void) {
int i=0; // local scope
using namespace X; // make names from X accessible
i++; // local i
j++; // X::j
k++; // error: X::k or global k?
::k++; // global k
X::k++; // X::k
}
// using-declaration example:
void f2 (void) {
int i=0; // local scope
using X::i; // error: i declared twice!
using X::j; // ok
using X::k; // hides global k
i++;
j++; // X::j
k++; // X::k
}
Polluting the global namespace should always be avoided in non-trivial applications, however we often encounter tutorial code with an implied using namespace std; directive in the global scope to help the student focus on the actual code. We would never do this in production code. Ideally, the only name that should ever be visible in the global scope is the global main function. Everything else should ideally be put in their own namespaces and only imported into a local scope as and when they are actually needed. If we should require additional names to be accessible in the global scope, then these should be limited to just those names which represent truly global concepts.
Large programs tend to use a lot of namespaces and it can be tedious typing them out in full, particularly when they are nested or long and descriptive names. A using-declaration (at local scope) helps us to isolate just those names we are actually interested in, but if we need to use a lot of names from the same namespace, a using-directive helps cut down on the verbosity.
Namespace aliases are also useful for reducing long, descriptive names to a less verbose form in order to aid readability:
namespace American_Telephone_and_Telegraph { /* ... */ } // too long
// ...
namespace ATT = American_Telephone_and_Telegraph; // alias
You might ask why the programmer didn't simply use ATT in the first place, but short names greatly increase the risk of a name-clash. Thus it is better for the programmer to introduce shorthand aliases as and when they are actually required.
Naturally, we should avoid using-directives, using-declarations and namespace aliases in headers, because we cannot predict exactly where those names might be included, resulting in namespace pollution that can lead to some very obscure or subtle errors that would be difficult to track down.
What is the old Warcraft directory?
The old Warcraft directory was C:\games\Warcraft. This changes depending on which version (WC, WC2, WC3 and so on) as well as your operating system.
How do find the circumference of a circle?
The formula;
2 * Pi * Radius = circumference
Will calculate the circumference of a circle.
What is the programming language named after Blaise pascal's and who wrote it?
Pascal is the name of the language developed by Nicholas Wirth