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 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.

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 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%

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

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.

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();

}

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.

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.

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.

How many bytes in a const int?

The storage size of an int in C is loosely defined, and may be either 2 bytes or, more commonly, 4 bytes.

Whether or not it is defined as const won't affect the size.

Is float type array possible in C?

Yes. For example:

float f_array[3];
double d_array[2];

How primitive variables are stored on Stack?

Call-stacks are fixed-length and are allocated on a per-thread basis as threads are instantiated. The stack pointer CPU register keeps track of the next available address in the current thread's stack. The compiler computes the length of a function according to the number and type of its local variables (including formal arguments) plus the return address. When the function is invoked, the current stack pointer is adjusted by this amount, creating a "stack frame" specific to that function. Given the start address of the stack frame, the local variables and formal arguments can be referred to via constant offsets within the stack frame. When the function returns, the stack pointer is readjusted, effectively freeing the memory without actually releasing it back to the system. In this way, memory can be allocated and released on the stack with minimum cost.

What are the disadvantages of inline functions?

The inline functions is an optimization technique that is used by the compilers. The disadvantage of the inline functions is the increased binary size.