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

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.

How parallel port is used in turbo c?

Parallel port is the most simplest port of computer to use. It is too simple to use in Turbo C++ .

there are two types of parallel ports of computer

1. SPP (standard parallel port) = 0x3bc

2. ECP (Enhanced communication port) or EPP(Enhanced parallel port) = 0x378

parallel port is divided into three ports

1. DATA port = 0x3bc OR 0x378

2. control port = 0x3bd OR 0x379

3. status port = 0x3be OR 0x37a

data port is consists of 8 pins and use 8 bit binary code for controlling..

D7 D6 D5 D4 D3 D2 D1 D0

128 64 32 16 8 4 2 1

1 1 1 1 1 1 1 1 = 255..................send 255 int as data for binary all 1s

D7 D6 D5 D4 D3 D2 D1 D0

128 64 32 16 8 4 2 1

0 0 0 0 0 0 0 0 = 0..............send 0 int as data for binary all 0s

D7 D6 D5 D4 D3 D2 D1 D0

128 64 32 16 8 4 2 1

0 0 0 1 0 0 0 0 = 16............send 16 int as data for binary 1 in pin (D0)

D0= pin 2

D1= pin 3

D2= pin 4

D3= pin 5

D4= pin 6

D5= pin 7

D6= pin 8

D7= pin 9

outp(port,data); is the function use send data to the ports.

where ,

port is the integer value of port..... 0x378 or 0x3bc or 0x379 or 0x3bd or 0x37a or 0x3be.

data is an integer value to send ..ranges from 0 to 255

data=inp(port); is the function to receive input from port.

data is integer data .....0-255

port is the integer value of port..... 0x378 or 0x3bc or 0x379 or 0x3bd or 0x37a or 0x3be.

Example:

#include<stdio.h>

#include<conio.h>

#include<dos.h>

void main (void)

{

int data=0, portin=0x37a, portout=0x378;

//send 255 to port....using data pins.

data=255;

outp(portout,data);

//input from port using status pins...

data=inp(portin);

printf("\n%d",data);

getch();

}

In this way we control parallel port in turbo C++

What r conditional loops and unconditional loops in c?

A conditional loop will only continue to loop while the given condition is true:

while( i < 10 ) {

...

}

An unconditional loop either has no condition (a GOTO loop), or the condition is guaranteed to always evaluate to true:

while( true ) {

...

}

What is the value of expression 72 divided by c?

There is not enough information available to answer this question. The result of 72 divided by c will be an error if c is zero (0), a positive number if c is positive, and a negative number if c is negative.

How do you get the output12345 1234 123 12 1?

printf ("12345 1234 123 12 1\n");

... or, did you mean to do it with loops ? ...

int i, j;

for (i=5; i>0; i--) {

for (j=1; j<=i; j++) printf ("%d", j);

printf (" ");

}

printf ("\n");

Why header file called so?

Because it's always first at the head of all c files.

Write a c program to add all numbers between 100 and 200 which contain the digit 5 along with steps?

#include

int main(void)
{
int a;




for(a=100;a<=200;a++)
{

if(a%10==5)
{
printf("%d\t",a);



}



}

}