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

What is a TSR?

A TSR is a Terminate and Stay Resident program. Such a program stays in the memory even after the user exits it, so that it can be recalled by hitting a custom key(s). To write TSRs, you need an understanding of how to interact with hardware on your computer through pointers. It needs a good knowledge of C, and there are some good books specifically on TSRs. But those are not used much anymore, since the advent of windows :).

How would you write - 36 divided by the sum of 9 and 3?

(-36)/(9+3)

I would use parenthesis to execute proper order of operations.

How do you find the greatest number of 2 in C?

#include<stdio.h>

void main()

{

int a,b;

printf("enter two number");

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

{

if(a>b)

printf("a is big");

}

else

printf("b is big");

getch();

}

Why is the operation pop in the data structure stack called pop?

It stems from the analogy of a plate-stacker. That is; a recessed pit with a spring-loaded platform that pushes upwards. As plates are stacked onto the platform, the spring is compressed by the weight of the plates, pushing the platform down into the pit so only the top plate protrudes from the pit. When the top plate is removed, the stack pops up to expose the next plate.

The push and pop verbs apply to all linear sequence containers where a new element can be added at the front and/or back ends of the sequence, such as arrays/vectors, lists, queues and stacks.

Is the identifiers 'name' and 'NAME' different in c?

Yes they is different, C language are case-sensitive.

What are the different types of infarcts?

An infarct occurs when proper blood flow has been restricted to the point of tissue death. There are two types of infarcts, hemorrhagic and a white infarction.

What is named user plus perpetual?

Named User Plus is the licencing metric for a single unique user. Perpetual relates to the term of the licence. Being perpetual means that the licence lasts for life.

Size of a variable without using sizeof operator?

Declare 2 pointer variable of the same type and assign the address of the variable to them and then increment one of them.

Find the difference between the above 2 pointers using a type cast. This will be the size of the variable.

Eg:

double i;

double * p = &i;

double * q= p;

p++;

cout<<(int)p-(int)q<<endl;

Swapping of number with using third variable?

To swap two numbers N1 and N2, using a third variable T... T = N1;

N1 = N2;

N2 = T;

What is the c word?

The c word is a very bad word. I'll give you a hint it rhymes with bat... Its cat.

How do you convert binary to hexagon?

Well, I believe you mean hexadecimal, not hexagon. Just like DECImal is base 10, BInary is base 2 and HEXADECImal is base 16. To convert by hand, you can convert binary to decimal, then decimal to hexadecimal.

For instance, 1011001 becomes 1*64 + 0*32 + 1*16 + 1*8 + 0*4 +0*2 +1*1 = 89.

Now we need to convert that to hexadecimal, so write out the the powers of 16: 16^0 = 1, 16^1 = 16, 16^2 = 256.

256 is larger than 89, so we only need two digits.

For the first digit:

16*1=16, 16*2=32, 16*3=48, 16*4=64, 16*5=80, 16*6=96.

96 is larger than 89, so the first digit (the 16^1 position) is 5.

Subtract 80 from 89 = 9.

16^0 = 1. 1*9 = 9. The second digit is 9

The hexadecimal equivalent is 59

Alternatively, (and faster) you can write out groups of four binary digits.

(Binary) = (Hexadecimal)

0000 = 0

0001 = 1

0010 = 2

0011 = 3

0100 = 4

0101 = 5

0110 = 6

0111 = 7

1000= 8

1001 = 9

1010 = A

1011 = B

1100 = C

1101 = D

1110 = E

1111 = F

Then segment the binary number into groups of four

(e.g. 10011010111001 becomes 10 0110 1011 1001 -- you can pad the first group with 2 zeroes to make it a group of 4)

and use the above mapping to turn that into 26B9.

Why pointers are required?

The most important use of pointers comes when we pass value by reference to any function. You do not need to create a second memory location as in pass by value. You can mofify the original variable by using its address.

What is the algorithm of the program to find sum and average of n different numbers?

1. start

2. sum=0

3. input n

3. for i=1 to n do

4. input x

5. sum=sum+x

end of for (3)

6. avg=sum/n

7. output sum, avg

8. stop

What is a FIFO array?

It means that elements are fetched from the array in the same order they arrive - first in, first out (FIFO). Also called a queue.

It means that elements are fetched from the array in the same order they arrive - first in, first out (FIFO). Also called a queue.

It means that elements are fetched from the array in the same order they arrive - first in, first out (FIFO). Also called a queue.

It means that elements are fetched from the array in the same order they arrive - first in, first out (FIFO). Also called a queue.

Write a c program to find the maximum of two numbers and print out with its position?

maxValue = function (array) {mxm = array[0];for (i=0; i<array.length; i++) {if (array[i]>mxm) {mxm = array[i];}}return mxm;};

i don't know

What are the methods of hash table?

See the related link below for the Java API documentation for the Hashtable class and its methods.