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 ascii value of EOF?

There is no ascii value for EOF. The constant EOF is a special value, not representing any character, but indicating an eof-of-file or error condition when using stream I/O.

On the other hand, there is an ascii charactor end-of-file, <CTRL>Z, 26, or 0x1A which, in the DOS era, indicated the end of file in a text file, but this is not the same as the run-time library constant EOF.

Convert 160 from decimal to binary?

160 converted to binary

Start with highest number

128 goes into 160 (160 - 128 = 32)

64 does not go into 32

32 goes into 32 (32 - 32 = 0)

rest of numbers are zeros.

128 64 32 16 8 4 2 1

1 0 1 0 0 0 0 0

Binary number is 1010000

What are the application of this pointer can you use this pointer in friend function justify?

The this pointer can only be used within nonstatic member functions. Friend functions are not members so they have no access to a this pointer. However, you can pass a specific instance of a class to a function via a class reference argument.

To understand how friendship works, first understand that a nonstatic member function has the following properties:

1. It has private access to the class.

2. It is scoped to the class.

3. It must be invoked upon an object of the class (has a this pointer).

Static member functions have the first two properties while friend functions only have the first property.

What is the meaning of the variable org 100h in assembly language?

ORG isn't a variable its an assembler directive.

The command ORG is the ORiGinate command which sets the start of the assembled code. ORG 100h means originate this block of assembled code at the location 100 hexidecmal.

Note: the Origin point of the code block does not HAVE to be the execute point in asssembly language. Therefore you could ORG at 100 hex and exec the code at 150 Hex.

What are some of the attributes of pure virtual function?

A pure-virtual function is not unlike a virtual function, except that you needn't provide a default implementation like you must do with a virtual function. But whether a generic implementation is provided or not, the class is rendered abstract, which means you cannot instantiate the class directly -- you must derive a new class. Indeed, the only reason for declaring a pure-virtual function is to render the class abstract.

Why would you design a class that cannot be instantiated other than by derivation? There are many reasons, but ultimately the class is intended to represent a conceptual object rather than an actual object. A conceptual object is a generic object that encapsulates everything that is common to all its derivatives, but one that cannot provide a complete implementation of its interface.

For instance, circles and squares are actual objects that share a common concept: they are both types of shape. Thus circles and squares (and all other shapes) may be derived from a generic shape object. The shape object can encapsulate everything that is common to all shapes, such as colour attributes, line width and style, and so on. It can also provide common interfaces such as draw(), rotate() and so on. But it cannot implement these interfaces without knowing what type of shape it actually is. While you could use expensive runtime type information within the base class to determine the type of shape and write reams of base class code with switch statements to cater for all possible shapes, this makes no sense (and would be a maintenance nightmare) when the derivatives have all the information required to implement these interfaces. Thus the abstract shape class exists to provide a common interface while each specific shape fills in the details and provides the actual implementation.

The derivative must provide an implementation for the pure-virtual method (augmenting or replacing any generic implementation, where one exists) otherwise it becomes abstract itself. But once a derivative implements a pure-virtual function, the function becomes a normal virtual function with respect to any of its derivatives. That is, derived implementations can be inherited, but the base class implementation (if one exists) cannot be inherited.

A pure-virtual function is declared like any other virtual function, by prefixing the function with the virtual keyword. The difference is that you must append =0 after the function signature:

class abstract

{

public:

virtual void my_function()=0;

};

If a generic function body is require, it can be declared externally:

void abstract::my_function()

{

// ... function body goes here

}

Or it can be declared inline:

class abstract

{

public:

virtual void my_function()=0{ /* ... function body goes here */ }

};

How Can We Solve The Limitation Of Getchar And Scan Function?

Getchar:-Reading a single character can be done by using the function getchar.

Syntax:- variable_name = getchar ( );

Variable_name is a valid 'c' name that has been declared as char type. When this statement is encountered, the computer waits until a key is pressed and then assigns this character as a value to getchar function. Since getchar is used on the right hand side of an assignment statement, the character value of getchar is in turn assigned to the variable_name on the left. The getchar function may be called successively to read the characters contained in a line of text. Getchar accepts space character.

Scanf ("control strings",arg1, arg2, ………… argn);

The control string specifies the field format in which the data is to be entered and the arguments arg 1, arg 2, arg n specify the address of locations where the data is stored. Scanf does not accept space character.

How can you write an algorithm to read two numbers then display the smallest?

/* program to calculate sum of two no.s in c*/

#include<stdio.h>

#include<conio.h>

void main()

{

int a,b,sum; clrscr();

cout("enter 2 nos");

cin("%d %d ",&a,&b);

sum=a+b;

cout("sum is %d",sum);

getch();

}

C program to find the largest element in a row?

A row is just a one-dimensional array so, given a pointer to the first element of a row of doubles and the number of doubles in the row, we can use the following algorithm:

// returns the largest double in an array of size count

double get_largest (double * p, unsigned count) {

if (p==NULL size==0) { /* invoke invalid argument handler */ }

double result = *p; // store first value in row (dereference the pointer)

while (--count) { // repeat for the remainder of the row

++p; // advance to the next element

if (*p > result) result = *p; // if the current element is larger, update stored value

}

return result; // return largest value

}

What was the problem with using valves in computer?

Reliability and heat were the main problems. Valves were fragile devices that, due to the relatively primitive way they were manufactured, failed pretty quickly. In addition to that, they gave off vast amounts of heat. This meant they needed expensive air-conditioning systems to keep their temperature down.

What are the operation performed by MPU?

The basic operations performed by MPU are under as follows:

(1)Memory Read

(2)Memory Write

(3)Input/Output Read

(4)Input/Output Write

How do you draw cone in c program?

A cone is a 3-dimensional shape, while drawing on a computer is generally limited to two dimensions, and projection of three dimensions onto a flat (two-dimensional) canvas.

You can draw a cone very easily onto a 2-dimensional canvas if you are free to chose the viewing angle, and if that viewing angle does not need to change.

You could draw a triangle and state that it shows a side view of the cone, you could draw a circle and state that it shows the bottom view of the cone, or you could draw a circle with the center point marked, and state that it shows the top view of the cone.

You could draw all three, top, bottom and side view, and state it shows the cone in all three dimensions, in the way most 3-dimensional objects are shown in a technical drawing.

For creating a projection of a 3-dimensional cone from an arbitrary viewing angle, you should consult dedicated (but non-trivial!) literature on 3-D rendering. Many languages also support 3D graphics toolkits such as OpenGL.

How can arrays be used for inter function communication?

The size of a function can be determined from the size of the array. Arrays and functions are both used in computer programming.

What is handsome number in c programming?

Handsome numbers are the numbers in which the sum of all the left side numbers is equal to the last number for example 123 - 1+2=3 its a handsome number

What are some occupations that begin with the letter T?

Some jobs that begin with the letter T include:

  • T-Shirt Printer
  • Taco vendor
  • Tailor
  • Talent scout
  • Talent Scout
  • Talk show host
  • Tank Car Loader
  • Tank driver
  • Tanner
  • Tap dancer
  • Tap instructor
  • Taper
  • Taster
  • Tattoo artist
  • Tattooist
  • Tax Advisor
  • Tax attorney
  • Tax collector
  • Tax consultant
  • Tax preparer
  • Tax Preparers
  • Taxi driver
  • Taxidermist
  • Tea Blender
  • Tea Taster
  • Teacher
  • Teamster
  • Technical Director
  • Technical Editor
  • Technical Writer
  • Technician
  • Technologist
  • Telecommunications Engineer
  • Telecommunications Equipment Installer Repairer
  • Telecommunications Line Installer Repairer
  • Telegrapher
  • Telegraphist
  • Telekinetic person
  • Telemarketer
  • Telepathic person
  • Telephone Lineman
  • Telephone operator
  • Telephonist
  • Televangelist
  • Television Director
  • Television Engineer
  • Television Producer
  • Televisor
  • Telex Operator
  • Teller
  • Tenant Farmer
  • Tennis coach
  • Tennis player
  • Tennis professional
  • Tennis Professional Player
  • Tentmaker
  • Termite Exterminator
  • Terrazzo Worker
  • Terrorist
  • Test pilot
  • Test Taster
  • Tester
  • Textile Bleaching Dyeing Machine Operator
  • Textile Cutting Machine Operator
  • Textile Knitting Machine Operator
  • Textile Machine Operator
  • Textile Worker
  • Thatcher
  • Theatre Manager
  • Theatrical Agent
  • Theologian
  • Therapist
  • Thief
  • Ticket Agent
  • Ticket Taker
  • Tile Setter
  • Tiler
  • Tiller
  • Timber Cutter
  • Timekeeper
  • Timing Device Assembler
  • Tipster
  • Tire Builder
  • Tire fitter
  • Tire Repairer
  • Title Examiner
  • Toastmaster
  • Toll Collector
  • Tollbooth attendant
  • Tombstone Carver
  • Tool and die maker
  • Tool Grinder
  • Toolmaker
  • Tour guide
  • Tourist
  • Tow Truck operator
  • Towboat Captain
  • Town Clerk
  • Toxicologist
  • Toymaker
  • Tractor Operator
  • Trader
  • Tradesman
  • Traffic cop/officer
  • Traffic Engineer
  • Traffic Planner
  • Traffic Technician
  • Train conductor
  • Train driver
  • Train engineer
  • Train mechanic
  • Trainer
  • Training Manager
  • Traitor
  • Tram Operator
  • Transceiver
  • Transcriber
  • Transit operator
  • Transit Police
  • Transit worker
  • Translator
  • Transportation Attendant
  • Transportation Distribution Manager
  • Transportation Inspector
  • Transportation Security Screener
  • Transportation Ticket Agent
  • Transportation Worker
  • Trapeze Performer
  • Trapper
  • Trash-man
  • Travel agent
  • Travel Guide
  • Treader
  • Treasurer
  • Treasury Agent
  • Tree Surgeon
  • Tree Trimmer
  • Trench Digger
  • Trial Lawyer
  • Trolley Car Operator
  • Trombone instructor
  • Trombonist
  • Trooper
  • Trout Farmer
  • Truant officer
  • Truant Officer
  • Truck driver
  • Truck Loader
  • Trucker
  • Trumpet player
  • Trumpeter
  • Trustee
  • Tuba instructor
  • Tuba maker
  • Tuba player
  • Tugboat captain
  • Tugboat Skipper
  • Tumbler
  • Turbine Operator
  • Turkey Farmer
  • Turner
  • Turntable Operator
  • Tutor
  • TV Editor
  • TV repairman
  • Typesetter
  • Typist
  • Tyre maker/repairer

What is incremental compiler and it's working?

A computer-aided software development system includes programs to implement edit, compile, link and run sequences, all from memory, at very high speed. The compiler operates on an incremental basis, line-by-line, so if only one line is changed in an edit session, then only that line need be recompiled if no other code is affected. Scanning is done incrementally, and the resulting token list saved in memory to be used again where no changes are made. All of the linking tables are saved in memory so there is no need to generate link tables for increments of code where no changes in links are needed. The parser is able to skip lines or blocks of lines of source code which haven't been changed; for this purpose, each line of source text in the editor has a change-tag to indicate whether this line has been changed, and from this change-tag information a clean-lines table is built having a clean-lines indication for each line of source code, indicating how many clean lines follow the present line. All of the source code text modules, the token lists, symbol tables, code tables and related data saved from one compile to another are maintained in virtual memory rather than in files so that speed of operation is enhanced. Also, the object code created is maintained in memory rather than in a file, and executed from this memory image, to reduce delays. A virtual memory management arrangement for the system assures that all of the needed data modules and code is present in real memory by page swapping, but with a minimum of page faults, again to enhance operating speed.

G.M.Muktibodh the void?

the void written by gm muktibodh is a poem surrealistic poem which powerfully evokes the harrow ; destruction and violence that result from extreme self-absorption and sense of the meaninglessness of life . the word void here means the empty space (shoonya) or negative thinking which we have

What are the 6 types of c tokens?

A Token is the basic and the smallest unit of a program

There are 6 types of tokens in 'C'. They are:

1) Keywords

2) Identifiers

3) Constants

4) Strings

5) Special symbols

6) Operators

What is the most efficient algorithm for language translation?

It is called MEPS, (Multilanguage Electronic Phototypesetting System)designed by the Watchtower and Bible Tract Society. various forms of MEPS are used in more than 125 locations around the earth, and this has helped to make possible publication of the semimonthly journal, The Watchtower, in over 130 languages simultaneously.

Is 9 an integer?

s.. 9 is an integer but 9.a23 or any other decimal value isn't integer
Yes.