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

Example of a letter with enumeration?

TRAVEL INCLUSIVE UNLIMITED

36 Jasper Street, marcaripe, Cayman Islands

Telephone 789 4531, 789 4563; Fax 7894563

Ref VM / CL256

March 18th, 2010

The Principal

St Antonio Girls Collage

36-38 Jasper Lands

OTAHEITE

St Thomas VI

ATTENTION: 'MR ROHIT RAMKISSIOON'

Dear Madam

We are happy to have your enquiry about our 2010 Summer Special Form One students.

I am enclosing the latest edition of 'Sunshine Destinations.' On page 6 you will find full details of the tour package. However, I must emphasize the following:

  1. An advance payment of 25% is required to initiate the booking process.
  2. The next instalment is 50% upon conformation of arrangements.
  3. The final payment is upon arrival and registration.
  4. Payments for additional services must be made on demand.
  5. Hotels in the country districts provide three meals per day. Most of them provide laundry facilities/services.

6. Tours leave at 09:00 daily and are expected to return by 17.00

7. Babysitting and geriatric car are available but arrangements should be made when booking. Please forward to us within seven days the details requested on page 16 of the brochure. Please provide the information exactly in the same order as shown in the sample booking form.

Yours sincerely

TRAVEL UNLIMITED

Wayne Morris

Manger

Encl

Can a Ladder Diagram be converted to C?

Do you mean Ladder diagram in PLC? Ladder diagram ia graphical representation of instructions in PLC. These instructions themselves are higher level and are different from assembler instructions of the microprocessor used. If you can get the Statement List form (I am using Siemens terminology), then it is easy to convert it into C language. But is it required? A person familiar with PLC architechture will find it much easy to deal with Statement List than C language instuctions. If you are a computer Pro, use something like Structured Text, SCL etc.

What is different between primitive date type and non primitive data type in c plus plus programming language?

A primitive data type is built into the language - int, char, long, etc.

A non-primitive data type is am abstract data type that is built out of primitive data types - linked list, queue, stack, etc.

What ORGANIC compound has C-C-C-O-C-C-C-C?

Please rephrase your question with more detail.

Making a LOT of assumptions, the answer MIGHT be propoxybutane.

How do you pass enum object as argument to function in c?

You can't pass an enum as an argument to a function. An enum in C isn't an object, it's a type. All you can do is pass a variable that is of the particular enum's type.

If you have never learned any programming languages is it good to start with C?

Yes, it's. But you have to be ready for some work to do because C is a beautiful language but it's not trivial.

What is the binary conversion of the decimal number 21.125?

21,125(10) = 0101,0010,1000,0101(2)

or if it was a floating point, then the answer is architecture-dependent, on my computer:

20 is 0000000000003440

21 is 0000000000003540

22 is 0000000000003640

21.5 is 0000000000803540

21.25 is 0000000000403540

21.125 is 0000000000203540

21.1 is 9a99999999193540

WHAT IS logic programming language?

There is such subject as mathematical logic there are used predicated and etc. to define simple things. There is programming languages that use the same elements and they are used in search algorithms, artificial intelligence and other fields.

One of the most know such languages is Prolog.

It's different from other programming languages because of predicates ideology. You could tell that John is a man, at later ask such questions is John a man, who is a man and etc.

For example:

likes(david, samanta).

likes(samanta, tom).

?- likes(david, samanta).

yes

?- likes(samanta, david).

no

?- likes(samanta, tom).

yes

What is the last digit of pie?

Pi doesn't have a last digit - it goes on for infinity (it also doesn't seem to repeat itself, so there can't even be a philosophical argument for the last digit).

Draw a flow chart that displays the first 8 fibnocci numbers?

//program that displays Fibonacci series using arrays[]

//author: me

#include

#include

#include

void main ( void )

{

clrscr();

unsigned long f[3];

int i=0,s=2;

f[0]=1,f[1]=1,f[2]=0;

while(i<10)

{

f[0]=f[1]+f[2];

cout<

f[1]=f[0]+f[2];

cout<

f[2]=f[0]+f[1];

cout<

i++;

s++;

}

getch();

}

What is idiometric expression?

An idiom is a phrase where the words together have a meaning that is different from the dictionary definitions of the individual words, which can make idioms hard for ESL students and learners to understand. Here, we provide a dictionary of 3,167 English idiomatic expressions with definitions

http://www.usingenglish.com/reference/idioms/

How do you access the screen with c program?

Depends on the operating system. In UNIX it's ncurses,see the manual.

What do you mean by Hierarchy in C language?

The preference in which arithematic operations are performed in an arithematic expression is called as Hierarchy of operations.

Its very important in C Programming to predefine the Hierarchy of operations to the C compiler in order to solve the given arithematic expression correctly.

e.g.: If a programmer wishes to perform ,z=a+b/c;it may beinterpretedas z=(a+b)/c or z=a+(b/c).

and if a=3,b=6,c=2 then using the same expression we will obtain two differentanswersas z=4.5 or z=6.

To avoid this condition we must be aware of hierarchy of operations used in C programming.

In arithematic expressions scanning is always done from left to right.

The priority of operations is as shown below,

Priority

Operators

First

Parenthesisos brackets()

Second

Multiplication & Division

Third

Addition & Subtraction

Fourth

Assignment i.e.=



If we consider the logical operators used in C language,the operator precedence will be like;



Operators

Type

!

Logical NOT

* / %

Arithmetic and moulus

+ -

Aritmetic

Relational

== !=

Relational

&&

Logical AND

Logical OR

=

Assignment



In the tables above,the higher the position of an operator,higher is its priority.

C code to find angle between hour hand and minute hand?

Lets start by thinking of a clock as a circle, with directly up being 0 degrees. At 12:00, both hands are at 0 pointing straight up. Every 60 minutes, the minute hand will make a complete revolution, so at any given time its angle is:

minute_deg = minute * 360 / 60 = minute * 6;

The hour hand will make a complete revolution every hour, so its formula is:

hour_deg = hour * 360 / 12 = hour * 30;

A function to find the angle would be:

int angleBetweenHands(int hour, int minute)

{

if(hour > 12) // In case of 24 hour clock

hour -= 12;

int angle = hour * 30 - minute * 6;

if(angle > 180)

angle = 360 - angle;

return(angle);

}

Why 1 is using as on state in binary language?

Computers are built off of electronic circuits, in which there is either no voltage or there is some positive number (usually 3.3V, 5V or 12V). 1 represents an electric charge while 0 represents no charge.

What programming language can create an operating system?

Any. As long as a language has the programming structures to access memory directly (DMA, IO ports, IRQ) AND it can be compiled (isn't run at a command interpretor) it can be used to create an operating system: the more general the language, the more platforms that OS can run on i.e. Binary/Machine Language is extremely hardware specific, Assembler less so, C (and Pascal and Fortran) even less so, C++/Smalltalk/Eiffel the least.

An OS doens't have to be 50 quintillion lines of code; the original Linux kernel and a few Gnu utilities ran on one floppy disk (1.44 meg), DOS 5 was 3 floppy disks, Windows 95 took about 150 meg on a CD, Windows NT about 300meg on CD, and so on. As each version of operating system grows in features, so does it storage footprint.

How do you convert a C program into a Linux kernel module?

Quick Answer: You don't.

Long Answer: It will need a fundamental change before you can have a module that does anything similar. Kernel modules don't have the same purpose as programs. Kernel Modules are meant for device support and similar things. More than likely you don't actually want to move the program to kernel space.

Program to create a employee database?

Recs4frre.com will allow you to create an online employee database by basing your database on an existing template. There are a few templates on the site.

You can then set up users with different permission levels.

Employee photos can be uploaded and you can add or delete fields from the database.

For a local database try www.dms-intnat.com. This is not free but not too expensive.

Default value of register variable?

If you don't initialize it, you will find random garbage in it. (The same is true for auto class.)

Does having a void double pointer make sense in C?

No, 'void *' and 'double *' are ok; 'void double *' is syntax error.

On the other hand 'void **p' is totally correct: p holds the address of a generic pointer.

How do you find by program a given number is integer or float?

If it contains a decimal point or an exponential part, then it should be handled as a float (or double).

You can determine an existing variable's type in C using the type() function typeof is a gcc-extension, but not a function>

What are the types of data in a hash table?

Well hash tables can store any type of data be it the fundamental data types like int, float, char or derived data types like structure , strings etc

Implementation in C++ at the Related link below.

Write a program that defines a template function named add This function takes two arguments add two variables and then return the sum?

Write a program that defines a template function named add(). This function takes two arguments, add two variables and then return the sum. In main function, define two variables of type int, two variables of type float and two objects of type 'String'. Now call the add() function three times for these different data types. Note: String is a user-defined data type and for this you have to define a class named 'String'. When template function will be called to add two objects of type String then it must concatenate two strings. Your output should look like this: Sample Output: Enter two integer values to be added Enter First value: 12 Enter Second value: 25 Enter two float values to be added Enter First value: 13.5 Enter Second value: 14.2 Enter two Strings to be added Enter First value: Virtual Enter Second value: University Addition of two variables of different data types Sum of values of type int = 37 Sum of values of type float = 27.7 Sum of values of type String = VirtualUniversity