Explore BrainMass


C is a general-purpose programming language created in the late 60s and early 70s in Bell Labs.


Dennis Ritchie, creator of C and, with Ken Thompson, Unix, wearing his National Medal of Technology awarded by President Clinton


In keeping with ALGOL tradition, C's design centers around structured programming, utillizing recursion, lexical variable scope and a static typing system which prevents many common typing errors programmers can make. C's strength and staying power in industry stems from its structure mapping so well onto typical machine instructions, thus it can be used instead of, or rewritten from, very low-level assembly language. Perhaps C's greatest application so far is its use in the system software of the Unix operating system. This has helped make it one of the most widely-used programming language of all time, and although C++ is more common in many place today, C is still a staple that is taught in most computer science degree programs.

Other effects of the popularity of C is that almost all computer architectures and operating systems support it by having an efficient compiler ready for C programs. C has also provided a basis for many new, more specialized languages such as C#, D, Go, Rust, Java, JavaScript, Limbo, LPC, Perl, PHP, Python and more, both in syntax and concepts. This has helped unify programming languages to some extent; even though a language's type systems, data, models, and semantics may be radically varied, many basic expressions and statements are recognizable to a decently fluent programmer across languages thanks to the C base.

C is a fairly low-level language, as languages go, but this gives the user more control as to how they manage their memory, etc. and can result in faster programs than something like Java which takes care of these details 'behind the curtain'. In addition, the straightforwardness of most C compilers make it easy to program something that will run on many platforms (which was a goal in designing C) and require minimal run-time support, which programmers everywhere are sure to appreciate. 


Icon photo is the cover of The C Programming Language (also known as the C Bible and K&R), authored by Brian Kernighan and Dennis Ritchie. Photo credit Julesmazur.

C Language: User defined functions

Using C visual express write a function that: // gets an integer from the user and returns it // make 3 calls to this function: // 1.. To get the radius of the circle from the user and return it to main // 2.. To get the length of the rectangle from the user and return it to main // 3.. To get the width of the rectangle

Insertion Sort and Selection Sort Using C

Implement insertion sort and selection sort using C programming language: 1. Generate an array of random integers to be sorted using either insertion sort or selection sort. 2. Allow the user to specify the number of integers in the array to be sorted in the main function. 3. Allow the user to specify the range of random i

2D Array in C to Generate Report for a Service Calls Company

2 dimensional arrays Service Calls Company Report Service Calls Company Report The Service Handlers Company handles daily service calls (phone calls) from customers. The company handles clients' problems over the phone. The company needs to generate a a summary on the calls made in a given month. The data collected is eac

Write a C Program that Will Calculate the Pay for Employees

I am looking for help with my class assignment for C Programming. I need to write a program that will calculate weekly pay for employees. For each employee the program should prompt the user to enter the clock number, wage rate, and number of hours. The clock number is a unique identifier for an employee, the wage rate is the

Use of functions in C for a teller machine

I am new at this programming stuff, and functions are confusing to me. I think what I do is replace some of the text from tutorial 5 with functions, but not quite grasping what to do. I have, and will, continue to read more about these to further try to understand this. I practiced some more with what I learned in tutorial 5, an

Complete C Code for Calculating Total Currency

I have been working on this tutorial for awhile now. I will state what the output should look like. My program will do some computation with two numbers. The two numbers used by this program are 22 and 16. The Sum of 22 and 16 is 61 The Difference of 22 minus 16 is 11 The Product of 22 times 16 is 900 When 22 is divide

The solution gives a complete c++ program on calculating the stress and strain in a steel rod of diameter D (inches) and length L (inches) subject to the compression loads. Explainations are added after some important codes. A screenshot of output is also given.

Write a main function and the following functions to compute the stress and strain in a steel rod of diameter D (inches) and length L (inches) subject to the compression loads p of 10,000 to 1,000,000 pounds in increments of 100,000 pounds. The modulus of elasticity E for steel is 30 x 10 with an exponent of 6. A function to co

The solution gives a complete C program on computing the diameters of steel rod, aluminum rod, and copper rod using the given formula. The output of the program is also provided for reference.

A program to compute the diameter in centimeters of steel rod, and aluminum rod, and a copper rod, which can withstand a particular compression load. The allowable compression stress of steel, aluminum, and copper is 25,000 lbs/m², 15,000 lbs/m², and 20,000 lbs/m², respectively. Area of rod = compression load ______

What is the personnel shortfall during weeks 5 and 6?

Using the chart given in the attachment(Personnel_Shortfall.docx), with durations shown in weeks, if there are 16 total people available for the project (assume all 16 are qualified to work on any of the tasks and assume all tasks start and finish at their earliest times), what is the personnel shortfall during weeks 5 and 6?

List Program C++

You are to implement a 'List' class to handle a list with general operations. That means you can insert and delete any element anywhere in the list. The list has no order, except for the order you insert or delete. The methods you are to implement are as given: Constructor methods (two, default and copy constructor, a list to

Discrete Mathematics and Functions

1. Let f be any function from R to R. Define a relation Rf by the rule: x Rf y if and only if f(x) = f(y). Show that Rf is an equivalence relation. (Hint 1: first consider a simple specific case, such as f(x) = x2. That is, x and y are related if and only if x2 = y2. Then consider the general case. Hint 2: Think about c

Is this a #define issue?

The following code fragment produces the correct result sometimes and sometimes it does not. Explain what is happening and why. #include <stdio.h> #define max(a,b) ((a) > (b) ? (a): (b)) void main(void) { int i = 0; int j = 0; int a = 3; int b = 4; int c = 6; int d = 5; i = max(a,b); j = max(c,d); printf("i = %i,

Programming with C: Loops

Create a program that asks the user to enter a number from 1 to 50. Print the statement "Programming is fun" the number of times entered by the user using a for loop. Print the statement "Spring break is fun" the same number of times using a while loop.

Conditional Expressions and Functions

1. Given the variables isFullTimeStudent and age , write an expression that evaluates to true if age is less than 19 or isFullTimeStudent is true. 2.Write an expression that evaluates to true if and only if value of the integer variable isAMember is false. 3. Write a conditional that assigns true ( 1 ) to the varia

Swapping and Toggling Values of Variables in C

1 Given two int variables, i and j , which have been declared and initialized, and two other int variables, itemp and jtemp , which have been declared, write some code that swaps the values in i and j by copying their values to itemp and jtemp , respectively, and then copying itemp and jtemp to j and i , respective

using functions in C

see attached...rewrite the program shown using functions per the direction....please use C and keep it simple. please make sure the program will run on C

Program in C to Test Students

We have to use rand() to get 2 numbers in random each time and ask student to find the correct solution.. First we start with numbers 1 to 6.If we get 4 and 5 then the program will ask "how much is 4 times 5 4x5 = " Then the student will be able to give the answer, If it is correct then it will be typed on screen "Correct" other

Introduction to C

Bob, My attempt resulted in the statement below and I am not sure were the prob is; also i have a small green rectangle on the field that preceds the cursur when i enter the code. This rectangle does not appear in your notes...any suggestions? //header #include<stdio.h> int main (void) { printf( "Hello Chuck/n" )


Written Assignment: Grade Book Program Your English instructor, realizing you are a programmer, asks you to write a Grade Book program for his class to help him compute final grades. Design a program that asks for the student’s name and four test grades. You are to display the student’s name, four test grades, the average o

Grade Book Program Algorithm to Compute Final Grades

Your English instructor, realizing you are a programmer, asks you to write a Grade Book program for his class to help him compute final grades. Design a program that asks for the student's name and four test grades. Display the student's name, four test grades, the average of the four test grades and the final letter grade the s

Chess game in C language

Create table game characters 8x8, where will store THE POSITION OF Figure each time on this chessboard. The creation of the list must be made with commitment memory. In addition create structure (struct move) to be used for the registration movements with the elements: CHAR OVER, char prevpos[2], char nexpos[2], move *next,

Programming: Gantt Chart

Assume you have a project with seven activities Labeled A-G, as shown below. Derive the earliest completion time (or early finish time - EF), the latest completion time (or late finish - LF) and slack for each of the following tasks (begin at time =0). Which tasks are on the critical path? Draw a Gantt Chart for these tasks

How many elementary operations are used in the following algorithm?

1) Use the method of Iteration to find a formula expressing S(n) as a function of n for the given recurrence relation and initial condition: S(n) = S(n-1) - 3, S(0)=5. 2) How many elementary operations are used in the following algorithm? The elementary operations are comparison operations (such as > and < ) and mathematical

C++ secret message decoder program

For each the following programs, ensure you use the file names identified, comment in an appropriate manner, format your code appropriately (vertical and horizontal whitespace... aka. blank lines and tabs), and use good/appropriate variable names. You should expect the user to always type appropriate input (e.g., not words when

C programming of a linked list

Write a C program that initially presents a menu of choices for the user. The menu should consist of the following choices: Create an initial linked list of students and grades. Insert a new student into the linked list. Modify an existing student in the linked list. Delete an existing student from the linked list.

Graphical Characteristics

Please see attached file. (a). List the vertices in graph A in the reverse order of their visit (finish) time for a depth-first search that starts at vertex A. Repeat the process, and produce a different list by assuming that the scan accesses neighbors in a different order. (b). List the vertices in graph B in the reverse

Important information about C Programming Help

It will be necessary for you to access Service Request: ¿SR-kf-008, Tax Calculator¿ from the Virtual Organizations portal. Complete Change Request #1. Insert comments in the program to document the program internally. Attach a design flow chart to a hard copy or email of the source code of the program. Service Request SR-kf

Data Types

Q1.Write the decimal equivalents for these IEEE floating point numbers a. 0 10000000 00000000000000000000000 b. 1 10000011 00010000000000000000000 c. 0 11111111 00000000000000000000000 d. 1 10000000 10010000000000000000000 Q2. Add the following unsigned binary numbers then express the answer in decimal a. 01 + 101