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

Why do pointer occupy only 2 bytes of memory in 16 bit DOS environment?

You've answered your own question, I'm afraid. A 16-bit memory address requires 2 bytes of storage (8 bits * 2 bytes = 16 bits). Note that, without using XMS or EMS, you can only address 2^20 bytes of memory, with the last 384k or so being restricted (BIOS, video, etc) unless you enable the A20 line (it actually wraps from FFFF:0010 back to 0000:0000). Also, you should note that 16-bit pointers work because of a "segment:offset" feature; your current "data segment" determines where in memory your pointer actually points to. If you need a 4-byte pointer, use a far pointerinstead; these pointers can reference any point in memory (up to the aforementioned 1MB limit).

How do you find the second largest number among n numbers without using an array in c?

#include<stdio.h>

main()

{

int n,m,i,max;

printf("How many numbers(n) you going to enter:");

scanf("%d",&n);

printf("Enter the numbers:");

scanf("%d",&m);

max=m;

for(i=2;i<=n;i++)

{

scanf("%d",&m);

if(m>max)

max=m;

}

printf("The Largest Number is %d",max);

}

Here is a code with explanation and dry run hope it can be helpful

http://fahad-cprogramming.blogspot.com/2014/04/find-maximum-and-minimum-number-in.html

How do you Become a Chief Operator?

To become a Chief Operator, typically one must first gain experience in the relevant industry, often starting in entry-level positions and progressing through roles such as operator or supervisor. Pursuing a degree in a related field, such as engineering or operations management, can enhance qualifications. Additionally, developing strong leadership, problem-solving, and communication skills is essential, as Chief Operators oversee operations and lead teams. Networking and seeking mentorship within the industry can also facilitate career advancement.

What is the pseudo-code for finding all the factors of a positive integer?

The simple (brute-force) way to do it would be something like this:

For every integer i from 2 to n-1 do:

If n modulo i equals 0, output i.

This would be very slow for large n (linear in the size of n, in the best case).

What is Normalization Explain the condition under which a relation needs to be normalized to 3 NF fro3 2 NF with the help of an example?

Define normalization explain the conditions under which a relation need to be normalized to 2nf and 3nf with the help of an example ?

Is it true that in designing an object-oriented program the emphasis is placed on the procedures rather than on the objects needed to solve a given problem?

That is false; the very definition of object-oriented programming is to create objects that model real objects, which places an emphasis on data encapsulation, polymorphic objects, and so on to reduce code complexity, common programming errors, and other problems associated with a non-object-oriented language. The procedures are not nearly as important as the objects that are designed.

What is a broadside array?

broad side array very important array in this attenna communication

How do you programme Twos complement in binary in c?

int complement (int n) {

return -n;

}

or int complement (int n) {

return ~n+1;

}

both does the same thing.

Explain in details about get char?

#include <stdio.h>

The function getchar() returns an int corresponding to the next character in standard input. The value EOF indicates error or end-of-file.

What is the main function of design?

Communication, A designer's goal is to communicate something to all the pople who will see the design.

If null is compared with null what is the result-true or false or null or unknown?

You mean SQL?

NULL = anything IS NULL

NULL <> anything IS NULL

...

NULL IS NULL = TRUE

NULL IS NOT NULL = FALSE

If a certain sum of money at SI doubles itself in 5 yrs then what is d rate?

it is fifth root of 2 = exp (log 2)/5) = 1.1487 = 14.87%

The above applies to Compound Interest:

At Simple Interest I = PTR/100. In this case I = P, T = 5 and R is unknown.

100 x I = I x 5 x R ie 100 = 5 x R so R = 20%

Write the program that calculate power of a numbers?

#include<iostream.h>

#include<conio.h>

void main()

{

clrscr();

int n,x,y=1;

cout<<"Please enter x: ";

cin>>x;

cout<<"Please enter n: ";

cin>>n;

//Coding by: Snehil Khanor

//http://WapCPP.blogspot.com

for (int i=1;i<=n;i++)

y=y*x;

cout<<y;

getch();

}

What is anything that is used to determine values during the exchange of goods and services called a. Medium of exchange b. Barter c. Unit of account d. Store of value?

Anything that is used to determine values during the exchange of goods and services called a unit of account. This field of study is called macroeconomics.

How many strings can be formed of length 4 from a language containing 10 letters?

In a "language" containing just 10 letters, there are 10,000 four-letter permutations. It's easy to work out if you simply replace the letters with decimal digits 0-9. The first permutation is 0000, followed by 0001, 0002, 0003, ..., 9997, 9998 and 9999.

Find large number in the given two numbers?

int max = a>b?a:b; // set max to the larger of a and b

Difference between sizeof and strlen?

The sizeof operator returns the total size, in bytes, of the given operand, whereas the strlen function returns the number of characters in the argument up to but not including the first null-terminator.

Consider a character buffer allocated 50 bytes to which you assign the string "Hello world". The sizeof operator will return 50, but the strlen function returns 11.