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

Why a In the linked list structure Overflow can never occur unless the memory is actually full?

That's not quite true...

It is true that overflow in a linked list structure can not occur so long as there is at least one chunk of allocatable memory large enough to hold one element.

It is not true, however, that overflow can nover occur unless memory is actually full. This is because you can still have allocatable memory, while not having any contiguous chunks large enough to satisfy a single request.

How do you write a c program to accept 20 characters and display whether each input given is a digit a lower case or upper case using only arrays and while loops and for loops?

#include<stdio.h>

bool is_digit (char c) {

return (c>='0' && c<='9');

}

bool is_upper (char c) {

return (c>='A' && c<='Z');

}

bool is_lower (char c) {

return (c>='a' && c<='z');

}

int main () {

char input[20];

printf ("Enter a 20 character string containing digits and letters: ");

scanf ("%s", &input); /* beware of buffer overflow */

for (int index=0; index<20; ++index) {

printf ("The character at index %d is ");

if (is_digit (input[index]))

printf ("a digit.\n");

else if (is_upper (input[index]))

printf ("an uppercase letter.\n");

else if (is_lower (input[index])) printf ("a lowercase letter.\n");

else

printf ("a non-alphanumeric character.\n");

}

return 0;

}

What are the merits and drawbacks of using a person's foot as a standard?

The merits of a person's foot, you can use it anytime and anywhere, not unlike bringing lots of materials. But avoid your carelessness on using your foot. Because sometimes some people are not much accurate. So when they're measuring using their foot, the measurement might be not exact. Remember, even the greatest falls with this kind of measurement

What is minimal language?

Minimal language is considered to be part of the most important elements of communication. This works hand in hand with sensory organs and is said to be the primary language of communication.

What do the c and v in argc and argv stand for?

The letter "c" in argc stands for count. The letter "v" in argv stands for vector. You can visit this website for more info.......... http://www.dgp.toronto.edu/~ajr/209/notes/argv.html

What is the BNF of the for loop?

FOR ::= for ( [EXPRESSION]; EXPRESSION;[EXPRESSION]) STATEMENT

note: FOR itself is a STATEMENT as well:

STATEMENT ::= ...| IF | ELSE | WHILE | FOR | ... | EXPRESSION; | EMPTY_STATEMENT; | COMPOUND-STATEMENT | ...

Does each node in a doubly linked list contain a link to the previous as well as the next node?

Yes, each node in a doubly linked list contain a link to the previous as well as the next node. That is the definition of the doubly linked list.

What are the salient features of control array?

A control array is a collection of controls, such as buttons or text boxes, that share the same properties and event handlers in a programming environment, allowing for efficient management of similar user interface elements. Key features include the ability to dynamically add or remove controls at runtime, centralized handling of events for all controls in the array, and reduced memory usage by minimizing redundancy. This structure simplifies code maintenance and enhances readability by grouping related controls together.

How do you sort rocks?

You sort them by rocks, minerals, and fossils.

What is difference between Deep copy and shallow copy?

A "shallow" copy is when the member values are physically copied from one

object to another, *including* the values of any pointer or reference

members. If there are pointer or reference memebrs, then, those poointers

or references refer to the *same* objects as the original object, which is

usually a bad thing. That's why you want to define a copy constructor and

assignment operator for objects that contain pointers or references.

It's called a "shallow" copy because only the values of the

pointers/references are copied, instead of making copies of those

referred-to objects and setting pointers to them. *That* is what would be

called a "deep" copy, because it's going "deeper" into the structure,

copying everything, not just the first "layer".

Creating a notepad using c?

Hello Guys , Creating Notepad in C Langauge is too much easy . It's Just Fun...!

#include<stdio.h>

#include<conio.h>

int main()

{

FILE *open; //use to open file pointer//

//File_txt is created

opn=fopen("C:\\filename.txt" ,"w") \\use "w" for creating a file//

fclose(opn);

getch();

}

Difference between runtime error and logical error?

Syntax Errors and Logical Errors
  • Syntax errors -- Errors in spelling and grammar.
    • You can use the compiler or interpreter to uncover syntax errors.
    • You must have a good working knowledge of error messages to discover the cause of the error.
  • Logical errors -- Errors that indicate the logic used when coding the program failed to solve the problem.
    • You do not get error messages with logic errors.
    • Your only clue to the existence of logic errors is the production of wrong solutions.

There are 3 step to repair runtime error

If you got runtime error then there is a 94% chance that your computer has registry problems. To repair runtime error you need to follow the steps below:

* Step 1 - Download a runtime error repair tool,install this error repair tool.

* Step 2 - Click the Repair All Button.It will scan you PC for Free.

* Step 3 - Then click the Repair All Button again and your done! It is very easy to repair runtime error.

Here are the URL of runtime error repair tool:

http://www.fixerrorquick.com/ttfix-runtime_error-zz0005

Draw the recursion tree for the merge-sort procedure on an array of 16 elements explain why memoization is ineffective in speeding up a good divide-and-conquer algorithm such as merge-sort?

The MERGESORT algorithm performs atmost a single call to any pair of indices

of the array that is being sorted. In otherwords, the subproblems do not

overlap and therefore memoization will not improve the running time.

otherwise........take the look at following:

It does not have the Overlapping Subproblems property.

(Not re-visiting subproblems.)

Needs lot of space to store solutions of subproblems.

Overlapping sub-problems property is as follows:

We accidentally recalculate the same problem twice or more.

Can you write more than 5000 lines c program?

Yes. However, it is not generally a good idea to do that, as it is better to break the solution up into smaller and more easily understandable and supportable modules.

What is different storage class in c?

Different from what?

Storage classes are auto, register, static, extern and typedef (formally).

How do you return an array from function?

By returning a pointer to the first element of the array.

What is the gcd of 60 and 126?

60=6*10, 126=6*21, so their gcd is 6.

I hope ot is not too late for your homework.

What is t he loop pattern that opens toward the thumb is known as?

im not sure but if you find out could you please email me and ask me.

What is advangate of c language?

A popular programming language, available on many platforms.

National Audio Timer model TE903 what is this?

The National Audio Timer, Model TE903, is an early generation digital (segmented LED display) clock/timer made in the early 1970's by Matsushita Electronics of Japan. It allows the switching on and off of a 120VAC output and was intended for use in powering hi-fi stereos which were big at the time. It was switchable for 50/60 cycles and had a European style female recepticle to provide switched voltage. A very good and accurate clock.

Write a c program to sort three integer numbers using nested if statement?

// HI THIS IS MAYANK PATEL

/*C Program to find Maximum of 3 nos. using Nested if*/

#include<stdio.h>

#include<conio.h>

void main()

{

int a,b,c;

// clrscr();

printf("Enter three number\n\n");

scanf("d%d",&a,&b,&c);

if(a>b)

{

if(a>c)

{

printf("\n a is maximum");

}

else

{

printf("\n c is maximum");

}

}

else

{

if(b>c)

{

printf("\n b is maximum");

}

else

{

printf("\n c is maximum");

}

}

getch();

}