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

Largest of 3 numbers without using conditional or relational operators?

void main()

{

int a = 5;

int b = 7;

int c = 2;

int res;

res = (int)(a/b)?a:b;

res = (int)(res/c)?res:c;

printf("big num = %d",res);

}

When advantages do a procedural language have over a declarative language?

  • procedural language can also refer to a programming paradigm, derived from structured programming based upon the concept of the procedure call. Procedures, also known as routines, subroutines, methods, or functions.
  • declaration language defining basic data structures such as lists, maps, and trees of typed data in a compact, easy to read representation.A simple application programming interface (API) allows reading, writing and accessing all the data structures using one class. For property files, configuration files, logs and simple serialization requirements, SDL is designed to be an alternative to Extensible Markup Language (XML)

Is it the most efficient approach to access elements with the vector data structure?

Yes. A vector is a variable-length array but constant-time random-access is guaranteed regardless of an array's length.

Minimum size of stack to evaluate postfix expression?

Scan the postfix expression from left to right and count the number of values and the number of operators. The maximum value of their difference is the required stack size.

Eg:

1 2 3 + 4 + *

1 2 3 2 3 2 1 The maximum is 3.

What is the difference between enumrerated datatype and typedef?

Its very Simple that using Enumerated data type you are making special integers that flow within range, While a typedef is redefining data type with new name. Example: like defining enum Days{sun,mon,tue.....} makes an integer definition that can have 0-7 values So if u do following: Days x=sun; or Days x=0; then x=x+2; is 2 or tue and x=x+7; is 0 or sun again... Means its modulo 7 data type ................. While doing this: typedef Days WeekDays; renames Days as WeekDays Similary typedef int NUMBER; renames int as NUMBER .But wait it is one more name for the data type.. So simply enum creates a numeral modular datatype with a range while typedef creates another name for it. Rupesh K Joshi

What is the C-suite?

there are six C - suite.

CEO - Chief Executive Officer

CFO - Chief Financial Officer

COO - Chief Operation Officer

CTO - Chief Technology Officer

CIO - Chief Information Officer

CMO - Chief Marketing Officer

WAP to initilize a character and print whether it is a vowel or not?

// short version

char c = 'a';

System.out.println((c=='a'c=='e'c=='i'c=='o'c=='u')?"VOWEL":"CONSONANT");

// easy to read version

char c = 'a';

switch (c) {

case 'a':

case 'e':

case 'i':

case 'o':

case 'u':

System.out.println("VOWEL");

break;

default:

System.out.println("CONSONANT");

}

Flush all in a c-program?

The fflush() and flushall() functions in the C run-time library do not write file changes directly to disk. These functions flush the file buffers provided by the library; they do not flush the buffers the MS-DOS, OS/2, or Windows NT operating systems provide at the system level.

In short clear the buffer memory.

What is the use of define key word in c?

Actually, the preprocessor is not part of the C compiler, but here you are: #define is meant to define symbols. Examples

#define NULL ((void *)0)

#define getchar() getc(stdin)

Why is 'C' the name-extension when saving a program in Turbo C?

Convention. Of course you can use any other extension, like 'helloworld.my-own-c-source' instead of 'helloworld.c' but why should you?

What are the next 3 letters in the following Sentence J F M A M J J A?

The letters represent the initials of the months: January, February, March, etc. That being so, the next 3 letters would be SON (Sept, Oct, Nov).

What is the difference between Conditional and Logical operator in C?

entirely different things

conditional operator:
? :

logical operators:
AND: &&
OR:
NOT: !

also you can count
XOR: !=

eg:
if ((a==3) != (b==c)) printf ("XOR: Exactly one of the two conditions is true\n");

Where can you get Omni-Psych Super Dizzy lv3 mugen char?

Not too sure, looking for her myself.. but I've found a version on www.esnips.com called "Omni-Psych Super Dizzy LV3" but I believe it's a fake, probably V1 or V2 but if you want those just search esnips, as for LV3 not sure sorry.

What is a strong number?

As to your question I'm a bit puzzled. 2 is larger than 1 and 20 is more than 10 but less than 30. Alright, so you already know this much I'm assuming your question may relate to the need for a strong password where there is a need for password protection.

If this is the case, the need for a large combination of letters and numbers (alpha/numeric sequence) is the same as stated above. Use as large a seuence as may be permitted for login. Some people suggest you keep a book nearby the computer to help you construct passwords and this can be a useful technique.

Try it out: Open the book and begin your password with the page number followed by the first letter of the each word in the first sentence (Use Capital letters if that is what you read and lower case letters if that is what you read. Or use the last sentence on the page or the first letter of each paragraph on the page.

Again, the longer and larger is the combination of your alpha/numeric sequencing the Stonger is the Password.

What is a TSR?

A TSR is a Terminate and Stay Resident program. Such a program stays in the memory even after the user exits it, so that it can be recalled by hitting a custom key(s). To write TSRs, you need an understanding of how to interact with hardware on your computer through pointers. It needs a good knowledge of C, and there are some good books specifically on TSRs. But those are not used much anymore, since the advent of windows :).

How would you write - 36 divided by the sum of 9 and 3?

(-36)/(9+3)

I would use parenthesis to execute proper order of operations.

How do you find the greatest number of 2 in C?

#include<stdio.h>

void main()

{

int a,b;

printf("enter two number");

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

{

if(a>b)

printf("a is big");

}

else

printf("b is big");

getch();

}

Why is the operation pop in the data structure stack called pop?

It stems from the analogy of a plate-stacker. That is; a recessed pit with a spring-loaded platform that pushes upwards. As plates are stacked onto the platform, the spring is compressed by the weight of the plates, pushing the platform down into the pit so only the top plate protrudes from the pit. When the top plate is removed, the stack pops up to expose the next plate.

The push and pop verbs apply to all linear sequence containers where a new element can be added at the front and/or back ends of the sequence, such as arrays/vectors, lists, queues and stacks.