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 Requirements or skills i should have to be good at C plus programming?

To be a good programmer in C++, your logic making should b strong. You should have a good memory, enough to remember the syntax of codes for c++. And most important of all, you should do regular practice. The more you will practice, more you will master it.

What are the primary differences between symbolic and high-level languages?

Symbolic languages have a near 1:1 relationship with the resultant machine code, thus the translation from source code to machine code is extremely trivial. For instance, the move instruction maps to several operation codes (opcodes) depending on whether the source and destination are working memory addresses or register addresses. However, there is no need to map each opcode to a separate mnemonic because the assembler can deduce the exact opcode from the operands alone. Thus all moves can be symbolised with a MOV mnemonic. So aside from choosing between opcode variants, translation from source code to machine code is relatively simple to program.

High-level languages have a higher degree of abstraction than symbolic languages (which is what we mean by high-level). A single high-level statement may generate many dozens of low-level instructions thus translation from source to machine code is far from trivial. However, programs don't need to be written in minute detail because the compiler handles all the machine-level details, many of which are highly repetitive (move values into registers, perform an operation upon those registers, act upon the result, rinse and repeat). This allows the programmer to express his ideas in code more freely.

What step is data either written to the file or read from the file?

Insertion is the process of writing data to a file. Extraction is the process of reading data from a file. More generally we use the terms output and inputrespectively. However, the output of one process can often be used as the input for another. Therefore the terms must be applied within the context of the objects being read from or written to.

How do you draw a flowchart to find maximum and minimum of given 3 input numbers?

You draw a flowchart to find maximum and minimum of given 3 input numbers by using all three numbers. You take the low, high and input the middle number between them. You can see the rise, or decline of the chart that way.

How do you write main menu pseudo code?

====

'-----------------------------------------------

'*** PROGRAM: Main Menu

' LANGUAGE: QBASIC: VERSION: QB64

'-----------------------------------------------

'------------------------------------------

'*** Global variable declarations list...

'------------------------------------------

userKeyPress$=""

'-----------------------

'*** Main Program...

'-----------------------

DO 'this is a menu driven program...

GOSUB clearScreen

GOSUB printMainMenuTitleHeading

GOSUB printMainMenuOptionsList

GOSUB printMainMenuInstructionsHeading

GOSUB printMainMenuUserInstructions

GOSUB awaitUserKeyPress

GOSUB checkUserKeyPress

LOOP UNTIL UCASE$(userKeyPress$) = "Q" '...UCASE converts lower case to upper

END '...END of program/halt program code execution

'----------------------

'*** Sub-routines...

'----------------------

clearScreen:

CLS '...(CL)ear the output (S)creen

RETURN

printMainMenuTitleHeading:

PRINT "MAIN MENU"

PRINT "========"

RETURN

printMainMenuOptionsList:

PRINT "Hit key: <1> for Program 1: 12 X Tables Square"

PRINT "Hit key: <2> for Program 2: Select a times tables to print out"

PRINT

PRINT "Hit key: <Q> to Quit!"

PRINT

RETURN

printMainMenuInstructionsHeading:

PRINT "USER INSTRUCTIONS"

PRINT "=============="

RETURN

printMainMenuUserInstructions:

PRINT "In order to select from the above Main Menu options list..."

PRINT

PRINT "First, chose the type of program you wish to run..."

PRINT "by, carefully, reading it's description."

PRINT

PRINT "Then, hit a corresponding single number/letter key, either: '1'/'2';"

PRINT "or, alternatively, hit key: 'Q' to Quit!"

PRINT

PRINT "-Thank you!"

RETURN

awaitUserKeyPress:

DO '...keep looping until when user presses any key...

userKeyPress$ = INKEY$ '...store any IN-coming KEY press

LOOP UNTIL userKeyPress$ <> ""

RETURN

checkUserKeyPress:

IF userKeyPress$ = "1" THEN GOSUB program1 '...GO to named SUB-routine

IF userKeyPress$ = "2" THEN GOSUB program2 '...GO to named SUB-routine

RETURN

program1:

GOSUB clearScreen

PRINT "PROGRAM 1"

'(...program 1/code goes here...)

GOSUB awaitUserKeyPress

RETURN

program2:

GOSUB clearScreen

PRINT "PROGRAM 2"

'(...program 2/code goes here...)

GOSUB awaitUserKeyPress

RETURN

What is statement of ownership?

Statement of ownership is a sworn statement made by a person affirming the legal ownership of real property. It is a legal document where a person swears that they do own something.

What are the various types of nutrients and their purpose?

Nutrient Function Sources Carbohydrates energy Potatoes, pasta, whole grains Minerals Regulate vital processes, necessary for formation of healthy bones and teeth Dairy, grains, vegetables Vitamins Help regulate digestion, absorption and metabolism of other nutrients Fruits, dairy, grains, nuts, meat Protein Growth, maintenance and repair of the body's cells, energy Fish, meat, eggs, milk, some soybean products Fats Regulate body temperature, supply energy, transport vitamins A, D, E, K in the blood, source of linoleic acid Fish, dairy, olive/canola/ soybean/cottonseed/corn oil Water Transports nutrients, carries waste from cells, vital to every body function Water, milk, juice, some fruits and vegetables

Advantages of Jackson structured programming?

The main reason modular (or structured) programming is important is that it avoids the increased possibility of data corruption. Of course modular elements still have that risk but that is usually down to the user (passing by Ref instead of by Val etc.). However by using non-modular programming you can easily corrupt data without even knowing it.

Non-Modular code is normally referred to as spaghetti code. Spaghetti code is typically code that uses lots of "GOTO" which although supported by VB should be avoided.

One bad point of GOTO statements other than the fact they jump around unpredictably is their reliance on line numbers. If u add a line in the wrong place it can literally destroy your code.

This is because the GOTO command is basically a one way link so somewhere else in the code. At the end of that code will be a GOTO to get back, this is considered very messy as it leaves a virtual "trail" that can not only make it hard for other programmers to understand but also jeopardise the reliability of data via unknown lines of code changing/interacting with the stored data.

It also means the programmer needs to make sure the GOTO's are in the right place which adds a greater chance of user related mistakes.

"Structured Programming" is a idea that Modularity is closely associated with. It is the idea that structuring the program makes it easier for us to understand and therefore easier for teams of developers to work simultaneously on the same program. One advantage of structured programming is reduced complexity. Modularity allows the programmer to tackle problems in a logical fashion. Also, using logical structures ensures that the flow is clear. It is also a time saver, without modularity, code that is used multiple times needs to be written every time it is used whereas all you have to do is call a function with that code in to get the same result in a structured program.

The algorithm check if the number is a palindrome number or not?

step 1 : input n

step 2 : s = 0, a=n

step 3 : while(n>0)

begin

rem=n%10

s=s*10+rem

n=n/10

end

step 4 : if(s==a)

print 'it is a palindrome'

else

print 'it is not a palindrome'

step 5 : stop

Why is interrupt driven IO better then polling?

Polling checks constantly the status of de I/O device, wasting CPU cycles. However with Interrupt driven I/O the device sends a request to the CPU to indicate that it needs attention.

So, in some cases, Interrupt driven I/O will be better than polling, because doesn't waste CPU cycles checking when the device needs attention.

Types of recursion?

Direct:

int foo ()

{ ... foo (); ... }

Indirect:

int foo ()

{ ... bar (); ... }

int bar ()

{ ... foo (); ... }

What is a registered entity?

one that has been registered at the local county level. Meaning an individual has paid for the use of the name registered - good for 5 years in most counties.

Explain any two advantages using Single linked list over Doubly linked list and vice-versa?

Advantages of single linked list:

# Decrease in storage space per linked list node # Simpler implementation Advantages of double linked list

# Decrease in work when accessing a random node

# Decrease in work when inserting or deleting a node

What are the advantages of data structure?

The tree structure is useful because it easily accommodates the creation and deletion of folders and files.

K L M explaination in SDH?

KLM are K= The Number channel of VC4

L= The Number channel of TUG-3

M=The Number channel of TUG-2

The mapping must be reference with G.707 and G.709 standand.

If you has question let's be contact to me.

Mail: Thammarak98@hotmail.com form Thailand Transmission Engineer.

Are the mean and standard deviation equal in a poisson distribution?

The mean and variance are equal in the Poisson distribution. The mean and std deviation would be equal only for the case of mean = 1. See related link.

How are data and functions organized in an object oriented program?

see in object oriented programming, data and function are packed inside one module in which data is only accessible by the function of it's own module and the function is the only way data can interact with other modules.In practical use even the private, public and protected things also came up.

What are the different pencil pointers?

the different pencil pointers are albert Einstein. Archimedes and some other jinjurikis