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 100 factorial?

100*99*...*2*1=

93326215443944152681699238856266700490715968264381621468592963895217

59999322991560894146397615651828625369792082722375825118521091686400

0000000000000000000000

Write a C program to accept a string from user and display its ascii value and then display sum of all ascii value of strings?

//C program to accept a string from user and

//display its ascii value and

//then display sum of all ascii value of strings

#include<stdio.h>

#include <string.h>

int main() {

char String[100];

int Sum,Index;

Sum=0; //Sum is initially zero

printf("Enter the string:\n");

gets(String); //Accept String from User

for(Index=0;Index<strlen(String);Index++)

{

Sum+=(String[Index]); //Adds (the ASCII values of) the String characters.

}

printf("The sum is %d\n",Sum); //Printing it as %d gives the equivalent ASCII value.

return 0;

}

Why Clearscreen in c language is used?

'Clearscreen' is not used in C language. TurboC has a clrscr function (prototype in conio.h).

Why not use the ampression symbol in scanf statement in function?

scanf is a function, not a statement. Example:

int a;

char name[12];

scanf ("%d %s", &a, &name[0]);

Why recursive solution is better for tree traversal?

Because a tree is a recursive data-structure. It's easier to write (and easier to understand) a recursive program for handling it.

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.