answersLogoWhite

0

📱

C Programming

Questions related to the C Computer Programming Language. This ranges all the way from K&R to the most recent ANSI incarnations. C has become one of the most popular languages today, and has been used to write all sorts of things for nearly all of the modern operating systems and applications. It it a good compromise between speed, power, and complexity.

9,649 Questions

Difference between runtime error and logical error?

Syntax Errors and Logical Errors
  • Syntax errors -- Errors in spelling and grammar.
    • You can use the compiler or interpreter to uncover syntax errors.
    • You must have a good working knowledge of error messages to discover the cause of the error.
  • Logical errors -- Errors that indicate the logic used when coding the program failed to solve the problem.
    • You do not get error messages with logic errors.
    • Your only clue to the existence of logic errors is the production of wrong solutions.

There are 3 step to repair runtime error

If you got runtime error then there is a 94% chance that your computer has registry problems. To repair runtime error you need to follow the steps below:

* Step 1 - Download a runtime error repair tool,install this error repair tool.

* Step 2 - Click the Repair All Button.It will scan you PC for Free.

* Step 3 - Then click the Repair All Button again and your done! It is very easy to repair runtime error.

Here are the URL of runtime error repair tool:

http://www.fixerrorquick.com/ttfix-runtime_error-zz0005

Draw the recursion tree for the merge-sort procedure on an array of 16 elements explain why memoization is ineffective in speeding up a good divide-and-conquer algorithm such as merge-sort?

The MERGESORT algorithm performs atmost a single call to any pair of indices

of the array that is being sorted. In otherwords, the subproblems do not

overlap and therefore memoization will not improve the running time.

otherwise........take the look at following:

It does not have the Overlapping Subproblems property.

(Not re-visiting subproblems.)

Needs lot of space to store solutions of subproblems.

Overlapping sub-problems property is as follows:

We accidentally recalculate the same problem twice or more.

How do you return an array from function?

By returning a pointer to the first element of the array.

What is different storage class in c?

Different from what?

Storage classes are auto, register, static, extern and typedef (formally).

Can you write more than 5000 lines c program?

Yes. However, it is not generally a good idea to do that, as it is better to break the solution up into smaller and more easily understandable and supportable modules.

What is t he loop pattern that opens toward the thumb is known as?

im not sure but if you find out could you please email me and ask me.

National Audio Timer model TE903 what is this?

The National Audio Timer, Model TE903, is an early generation digital (segmented LED display) clock/timer made in the early 1970's by Matsushita Electronics of Japan. It allows the switching on and off of a 120VAC output and was intended for use in powering hi-fi stereos which were big at the time. It was switchable for 50/60 cycles and had a European style female recepticle to provide switched voltage. A very good and accurate clock.

What is advangate of c language?

A popular programming language, available on many platforms.

What is the gcd of 60 and 126?

60=6*10, 126=6*21, so their gcd is 6.

I hope ot is not too late for your homework.

Write a c program to sort three integer numbers using nested if statement?

// HI THIS IS MAYANK PATEL

/*C Program to find Maximum of 3 nos. using Nested if*/

#include<stdio.h>

#include<conio.h>

void main()

{

int a,b,c;

// clrscr();

printf("Enter three number\n\n");

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

if(a>b)

{

if(a>c)

{

printf("\n a is maximum");

}

else

{

printf("\n c is maximum");

}

}

else

{

if(b>c)

{

printf("\n b is maximum");

}

else

{

printf("\n c is maximum");

}

}

getch();

}

Write a program for checking positive or negative number?

In Java:

if (myNumber > 0) System.out.println("The number is positive);
else if (myNumber < 0) System.out.println("The number is negative);
else System.out.println("The number is equal to zero);

In Java:

if (myNumber > 0) System.out.println("The number is positive);
else if (myNumber < 0) System.out.println("The number is negative);
else System.out.println("The number is equal to zero);

In Java:

if (myNumber > 0) System.out.println("The number is positive);
else if (myNumber < 0) System.out.println("The number is negative);
else System.out.println("The number is equal to zero);

In Java:

if (myNumber > 0) System.out.println("The number is positive);
else if (myNumber < 0) System.out.println("The number is negative);
else System.out.println("The number is equal to zero);

Are function prototypes necessary in C and Cpp?

Yes. Without prototypes you must ensure all definitions are declared forward of their usage. This isn't always possible. Separating the prototypes from the definitions means you can #include the prototypes forward of their usage, and place the actual definitions anywhere you like.

What is parameter in functions?

whatever the variables we declare in function signature to receive the arguments at the calling that are known as parameters..

e.g.

int sum(int a,int b);

here a & b are known as parameters.....

How to you write a program in with decimal values?

In C, decimal values are called "floating point" because the number of digits after the decimal point can vary. There are two types used for floating point operations: float and double.

Although the decimal point can shift anywhere within the number, C only allows a certain number of consecutive digits worth of precision. The float type only allows 7 consecutive digits, and the double type allows 15. Any digits before and after those consecutive digits are generally displayed as zero (0).

Here's an example program that uses the float type with arithmetic operators:

#include

void main()

{

float myfloat=0.0, counter;

printf("* perform addition on the float:\n");

for (counter=5; counter<10; counter++) {

myfloat+=(counter/10);

printf("myfloat is: %0.7f\n", myfloat);

}

printf("* perform subtraction on the float:\n");

for (counter=0; counter<5; counter++) {

myfloat-=(counter/10);

printf("myfloat is: %0.7f\n", myfloat);

}

printf("* perform multiplication on the float:\n");

for (counter=5; counter<10; counter++) {

myfloat*=(counter/10);

printf("myfloat is: %0.7f\n", myfloat);

}

printf("* perform division on the float:\n");

for (counter=2; counter<8; counter++) {

myfloat/=(counter/10);

printf("myfloat is: %0.7f\n", myfloat);

}

}

The %0.7f inside the printf() format string tells the compiler you want to display a minimal number of integer places, and no more than 7 decimal places. Play around with this value and see what happens.

If you compile and run this program, you may notice something odd. The last (right-most) decimal place has an errant number popping in. This is a result of the low precision of the float type. The following output is an example:

* perform addition on the float:

myfloat is: 0.5000000

myfloat is: 1.1000000

myfloat is: 1.8000001

myfloat is: 2.6000001

myfloat is: 3.5000002

* perform subtraction on the float:

myfloat is: 3.5000002

myfloat is: 3.4000003

myfloat is: 3.2000003

myfloat is: 2.9000003

myfloat is: 2.5000002

* perform multiplication on the float:

myfloat is: 1.2500001

myfloat is: 0.7500001

myfloat is: 0.5250000

myfloat is: 0.4200000

myfloat is: 0.3780000

* perform division on the float:

myfloat is: 1.8900001

myfloat is: 6.3000002

myfloat is: 15.7500000

myfloat is: 31.5000000

myfloat is: 52.5000000

myfloat is: 75.0000000

However, if you're displaying only a couple of decimal points, the discrepancy is generally unseen.

What do you do in order to access the run program?

#include<stdio.h> void main() {int k=10; prinft("%d,"&k"); }

What does the c mean in the date c 1786?

c means circa, which means it is an estimate.

What is the size of null pointer?

A NULL pointer has the same size as a non NULL pointer. NULL means that the pointer has been set to the NULL value that is usually zero (0) but the NULL value is at the digression of the compiler manufacture (and may have a value other than zero) so a pointer should always be set to the NULL value and not zero.

Current compilers (32 and 64 bit, Intel chip) have a pointer size of 4 (8 bit) bytes.

It should be noted that the number of bits in any data type is at the compiler manufactures digression but is heavily influenced by the computer hardware.

void *p= NULL;

printf ("%d\n", sizeof (p));

or

printf ("%d\n", sizeof (void *));

How do you close a string literal?

Just as you have started it.

good examples:

'string'

"string"

`string`

»string«

bad examples:

'string"

"string`

»string'

What are the advantages and disadvantages of using borland c plus plus version 5?

The only advantage is that it is free. But it is disadvantaged by the fact it only supports Windows 95, 98, NT and 2000. Thus it is not compliant with the current C++ standard, and is only useful for legacy development upon these Windows platforms.