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 The statements written by the programmer?

In languages that use a C-style syntax (e.g., C, C++ and Java) all code is written using expressions. Expressions may be combined to produce more complex expressions, however an expression or group of expressions only becomes a statement when terminated by a semi-colon. A group of statements enclosed by braces {} is known as a compound statement or code block.

Write a program to obtain transpose of a 4 X 4 Matrix in c using functions?

void main()

{

int arr[4][4];

int i,j,a,b,f;

printf("\nInput numbers to 4*4 matrix");

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

{

for(j=0;j<4;j++)

{

printf("\nKey in the [%d][%d]) value",i+1,j+1);

scanf("%d",&arr[i][j]);

}

}

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

{

for(j=0,f=0;j<4;j++)

{

if(i!=j&&f==0)

continue;

a=arr[i][j];

b=arr[j][i];

arr[i][j]=b;

arr[j][i]=a;

f=1;

}

}

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

{

for(j=0;j<4;j++)

printf("%d ",arr[j][i]);

printf("\n");

}

}

Why is it easier to convert numbers from binary to hexadecimal than decimal to hexadecimal?

A binary number system has two states '0' '1' for a long word in bits it can be as follows 101010101010101010101011 intimidating RIGHT? it can be represented in groups of 3 bits in octal 10/010/101/010/101/010/101/011= 22525253 digital or in group of 4 bits as 10/1010/1010/1010/1010/1010 = 2AAAAA

111 =7 octal 1111=f F in hexadecimal numbers 1000 =8 1010 =10 or A

WRITE A Program to convert integar to hexadecimal in c language?

Use the %X modifier of printf.

Code Example:#include int main(void) { unsigned int iMyNumber = 255; printf("The number %u interpreted as hexadecimal is %X.\n", iMyNumber, iMyNumber); return 0; }

How many types of parameters passing techniques are there In c language?

There are only two methods: pass by value and pass by reference. The function itself determines how arguments are passed into the function, as defined by the function signature. If the function accepts a reference, then the argument is passed by reference, otherwise it is passed by value. Pointers are always passed by value but behave like references. The only real difference is that pointer values may be NULL but references can never be NULL.

How do you make C plus plus Program Autorun?

This is not a C++ question. It is an operating system question. Different operating systems have different ways of making programs run on startup. Most of them have several different ways to accomplish this. In MS Windows, one way is to place a shortcut for the program in the "{percent}userprofile{percent}\Start Menu\Programs\Startup" shell folder.

What is a useful way of finding the value of a variable?

Reading a table, drawing a graph, drawing a diagram, and writing a equation.

Why are computer languages used for problem solving?

A programming language is a systematic notation by which we describe computational process. Computational process means steps for solving a problem.

Understanding of computer software is imperfect without a basic knowledge of programming language. Programming language allow the programmers and end users to develop the programs that are executed by a computer. In today's world several computer languages exist. Some of these are created to serve a special purpose (like controlling a robot), while others are more flexible. General purpose tools that are suitable for many types of applications.

However, every computer language must have instructions that fall into following categories like:

1. Input/Output

2. Calculations/Text Manipulation

3. Logic/Comparison

4. Storage/Retrieval

What are syntax rules?

Syntax is the discipline that examines the rules of a language that dictate how the various parts of sentences go together. While morphology looks at how the smallest linguistic unit (called morphemes) are formed into complete words, syntax looks at how those words are formed into complete sentences. Syntax is not prescriptivist - which is to say, it does not attempt to tell people what the objectively correct way to form a sentence is. Rather, it is descriptivist, in that it looks at how language is actually used and tries to come up with rules that successfully describe what various language communities consider to be grammatical or non-grammatical. Syntax deals with a number of things, all of which help to facilitate being understood and understanding language. Without rules of syntax, there would be no foundation from which to try to discern meaning from a bunch of words strung together, whereas with syntax, an infinite number of sentences are possible using a fairly small finite number of rules.
to put it simply syntax is the arrangement of words in a sentence or paragraph ect...

but the exact dictionary definition is:the study of the patterns of formation of sentences and phrases from words.


Syntax is the general rule that humans have to abide by which is that the composition of a coherent sentence using grammar and structure must be cognitively structured in the mind of someone's brain before they can communicate it to a receiver through means of making a series of small mouth noises. Syntax is the arrangement of words and phrases to create a message in a language.

Write the algorithm to find the largest number of three number?

To determine the largest of any group of numbers, we must first determine the largest of any two numbers. For that we use the following simple algorithm:


If number A is greater than number B, then return number A otherwise return number B.


In C++ we can encode this algorithm using the following template function: