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 are the applications of hardware interrupts in 8085?

The hardware initiates an interrupt when it feels that the situation requires the CPU's action.

Can you start a statement with do?

Yes, you can start a statement with "do." This is often seen in questions or emphatic statements, such as "Do you understand the instructions?" or "Do remember to bring your book." Using "do" at the beginning can emphasize the action or prompt further discussion.

What is flashing the BIOS for Dell Latitude 640C?

Flashing the BIOS basically means updating the firmware in your BIOS chip. You should always have a backup, and do this with extreme caution, as improperly flashing your BIOS could render your PC useless.

What are Memory locations assigned either the short or int can only store?

Memory locations are supposed to be stored in pointers.If you have to convert a pointer to integer, use data-type intptr_t from inttypes.h

What value is assigned to the type int variable ans in this statement if the value of p is 100 and q is 50?

It is not possible to answer this question without knowing the actual expression used in the assignment statement. The following are merely example expressions showing some of the values that could be assigned to ans:

int ans, p=100, q=50;

ans = p + q; // ans = 150

ans = p * q; // ans = 5000

ans = p - q; // ans = -50

ans = p / q; // ans = 2

ans = p % q; // ans = 0

What is the contents of the stack pointer after the execution of the call instruction?

On a near call, the stack pointer is 2 less than its original value. On a far call, it is 4 less.

What does 535m of c?

It seems like your question is incomplete or unclear. If you are asking about "535m of c," it could refer to a measurement of 535 meters in some context, but "c" is ambiguous. Please provide additional context or clarify what "c" refers to for a more accurate response.

Prove that if a DFS and BFS trees in graph G are the same than?

ok here we go...

Proof:

If the some graph G has the same DFS and BFS then that means that G should not have any cycle(work out for any G with a cycle u will never get the same BFS and DFS .... and for a graph without any cycle u will get the same BFS/DFS).

We will prove it by contradiction:

So say if T is the tree obtained by BFS/DFS, and let us assume that G has atleast one edge more than T. So one more edge to T(T is a tree) would result in a cycle in G, but according to the above established principle no graph which has a cycle would result the same DFS and BFS, so out assumption is a contradiction.

Hence G should have more edges than T, which implies that if the BFS and DFS for a graph G are the same then the G = T.

Hope this helps u......................

Writ evolution program ofInfix convert postfix without using classes or structures?

//made by vijay sahu

#include

#include

void main()

{

char p[20];

int stack[15];

int ts=-1,top=0;

int l=strlen(p);

cout<<" \n enter postfix expression";

cin>>p;

for(int i=0;i

{

if(p[i]>=48 && p[i]<=57)

stack[++ts]=p[i]-48;

else if(p[i]=='+' p[i]=='-' p[i]=='*' p[i]=='/')

{

int t1=stack[ts--];

int t2=stack[ts--];

switch(p[i])

{

case '+':

stack[++ts]=t1+t2;

break;

case '-':

stack[++ts]=t2-t1;

break;

case'*':

stack[++ts]=t1*t2;

break;

case '/':

stack[++ts]=t2/t1;

break;

}

}

}

cout<

}

C program for addition of two matrices?

I don't know the code, so I can't give it to you. But the algorithm is simple.

Matrices are usually stored as 2 dimensional arrays. Say M and N.

Then you make a loop, any loop, that goes through each row, during each loop, another loop will go over every single column (so row 1, col 1, then row 1, col 2, then etc.) Each time, the loop goes into row i and column j, add the entries of that row and column from M and N, (or M i,j + N i,j) and let it be the i,j's entry of the sum matrix.

Do the code yourself.

What has the author C C Salway written?

C. C. Salway has written:

'Refugees and industry' -- subject(s): Industries, Emigration and immigration, Refugees, Political refugees, World War, 1939-1945

What is the complexity of reverse the input string using stack?

O(n*2) for n characters.

It is more efficient to simply walk from both ends of the string, swapping characters as you go, reducing the complexity to just O(n/2).

What is the range of float?

i wann't ask the range of double float and long double float??

What is a canonical view for object oriented analysis and design?

canonical view

Common parlance loosely defines canonical views as the "front", "side", and "top" views of an object.

http://www.bmva.ac.uk/bmvc/2005/papers/264/paper.pdf

The term "canonical views" was first used by Palmer, Rosch, and Chase (1981). For more information on their experiements see:

http://www.kyb.tuebingen.mpg.de/publications/pdfs/pdf1507.pdf (its worth reading the section about the experiments to get a fuller understanding of their meaning) Given these facts, my best guess is that "canonical view" in the context of OOAD is what the application "looks like" from various points of view... UI, application layers and so on.

What happens if you assign a number with a decimal to an integer?

Some smart compilers will not allow you do that. If you managed to do that, there are couple different results, the most predictible is decimal part will be cut, only what left will be shown. If it exceed the amount of memory reserved for int (double > float > int), it will show the maximum or positive or negative value for int type, or it will shifted by some amount from the maximum or minimum.

Does a function call come before main?

It does not have to. What is necessary, is that a function be declared before using it, so you either need function declaration separately from definition, or you need to arrange the declaration/definition in the right order, which usually places the main() function last.

Is NULL valid for pointers to functions?

Depends on the language, the value of NULL (actual implementation and its value), and the definition of valid.

But in general, a pointer is an int, the value is a memory address of another data type (int, struct, or function, etc).

Because a pointer is an int, the value must be one of the integers defined.

if you have a derivative like:

#define NULL 0

then yes, NULL is a valid value for any pointer to functions

but "valid" is not the same as a "valid value". One may say "valid" means a pointer is pointing to an actual function, hence a pointer pointing to NULL is "Invalid".

How do you implement stack using linked list in turbo c?

Assume the Linked list has following operations

1.node* insert(node* node, bool head); /* head = true if insertion at head else insertion at tail */

2. node* remove(bool head); /* head = true if removal at head else removal at tail */

Now implement the stack functions as below.

STK_RET push(node* pnode)

{

node* head;

head = insert(pnode, true); /* insert the node at head */

if (head)

return STK_OK;

else

return STK_NOK;

}

similarly pop can be implemented to remove the node at head

Also the conventioin of inserting and removal from the tail can be used.

It is a good idea to eliminate all operator procedence rules and require parenthesis to show the desired precedence in expression why or why not?

Well, this is a matter of opinion, and different language designers do things differently.

Most languages use operator precedence, so that the programmer can say things like:

z = 2 * x + 3 * y

without having to mark everything up with parenthesis:

z = ((2 * x) + (3 * y))

Forcing the programmer to always use parenthesis eases the strain of remembering syntax and precedence, at the cost of less freedom for the programmer to express herself naturally.