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 a jurisdictional statement?

The section of an appellate brief that asserts the basis of appealability and the suitability of the court to hear the claim.

Wap to display the Fibonacci series?

#include<stdio.h>

main()

{

int a=0,b=1,n,c,i;

printf("enter number");

scanf("%d",&n);

printf("%d\n",a);

for(i=1;i<=n;i++)

{

c=a+b;

printf("%d\n",c);

b=a;

a=c;

}

getch();

}

How do you convert 50 from decimal to binary?

Repeatedly divide the decimal value by 2 and take the remainder (which can only be 0 or 1) until the decimal value is 0. The first remainder is the low-order bit, thus we work through the bits in increasing order of magnitude.

For example, decimal value 50:

50 / 2 = 25 r 0

25 / 2 = 12 r 1

12 / 2 = 6 r 0

6 / 2 = 3 r 0

3 / 2 = 1 r 1

1 / 2 = 0 r 1

Thus 50 decimal is 110010 in binary.

How do you print my name in c program in vertical manner using arrays?

you need strings to print any character(your name)

this is not possible useing array:D

How do you Write a program in c language to calculate the sum of two integers?

#include

#include

#include

void main()

{

char a;

int firstInt, secondInt, sum;

cout << "Enter two integers/n:";

cin >> firstInt >> secondInt;

sum = firstInt + secondInt;

cout << "The result is: " << sum;

getch(a);

}

What are storage classes in c?

There are four types of storage classes in c. It defines the scope and lifetime of a variable or function.

1. auto - This is the default storage class inside a function. Auto can only be used with in functions. i.e. only for local variables, not for globals.

2. register - The variables declared using the register storage class may stored in CPU registers instead of RAM. Since it doesn't have a memory location, the '&' operator for getting the address of the variable cannot be applied (in C). This storage class cannot be used for global scope data.

3. static - In case of local variable, it is initialized at compile time and retains its value between the calls. By default the static variables will be initialized to zero, in case of pointer variable initialized to NULL.

4. extern - Refers to a public variable defined somewhere else (often in a different source file.)

What is the similarities of High Level Language and machine language?

Nothing. Example:

machine code: 05 CA DE 12 15 47 A8

High level language: PRINT "Hello, World"

What is 58 c in c?

Conversion from Celsius to Fahrenheit is done in three steps:

1. Multiply value in degrees Celsius by 9.

2. Divide result of step 1 by 5.

3. Add 32 to result of step 2.

Conversion formula: [°F] = [°C] * 9 / 5 + 32 = 58 * 9 / 5 + 32 = 136.4 °F

CPU's operate in 3 modes 16 bit 32 bit and 64 bit Respectively the 3 modes are also called?

real mode, protected mode and long mode real mode, protected mode and long mode

Or: 16-bit modes (real, protected or virtual), 32-bit mode (protected), 64-bit modes

How newline character formed?

The newline or line-feed character is denoted by ASCII code 0x0A (decimal 10). In C, we use the escape-sequence '\n' to denote a new line. In some cases, particularly where the output is directed to a line printer, a newline is immediately preceded by a carriage return character, 0x0D (13 decimal), which is denoted by the escape sequence '\r' in C. Thus you will often encounter the "\r\n" escape sequence at the end of each line of ASCII text.

How do you search a character in a inputted string?

#include <iostream>

#include <string>

using std::string;

using std::cin;

using std::cout;

using std::endl;

using std::getline;

int main()

{

string myString = "";

cout << "Enter a string: ";

getline(cin, myString);

char mySymbol = 'a';

cout << "Enter a symbol to search for: ";

mySymbol = getchar();

bool symbolFound = false;

for (int index = 0; index < myString.length(); index++)

{

if (mySymbol false)

{

cout << "The symbol " << mySymbol << " was not found!";

}

cin.get();

cin.get();

return 0;

}

How do you print array variable without using array subscripts?

Well the most prolific answer to this query would be the use of pointers.Use a pointer and allocate it to the array of interest and start printing.

How do you initialize more than one variable in a for loop?

example with two variables (j and d):

for (i=0; i<10; ++i)

{

int j=1;

double d=8.0;

... more statements ...

}