Archive

Category Archives for "C Programming"

Strings in C

Strings: A string represents a group of characters. In C, we can create strings in two ways. The first way is to declare a character-type 1D array and initialize it with characters. Here, the size of the 2D array. Now, the marks obtained by several such classes in a school become an example for 3D […]

Continue reading

Characters in C

A character denotes any alphabet, digit or special symbol used to represent numbers, and special characters allowed in C. Handling Characters: Program to display character using printf() and scanf() function. Output: When a character is typed on the keyboard, it releases an integer number internally which is called ASCII(American (American code for information Interchange). For […]

Continue reading

Recursive Function in C

Sometimes a function calls itself, such a function is called ‘Recursive function’. For example if we want to find factorial value of 3. The factorial value of 3 is dependent on the factorial value of 2. Now, if we know that the value of factorial(0) is 1, all the preceding statements will yield the result. […]

Continue reading

Formal & Actual Arguments in C

Where do write functions?? A program contains main() function. When a new function is written, we can write the entire function, just before the main() function Another way to write the function is to write the function prototype function and then write the definition after the main() function. Formal arguments and actual arguments: When a […]

Continue reading

Functions in C

A function is a self contained program segment that carries out some specific. well defined specific task. Every c program contains one or more functions.One of these functions must be called ‘main’. Advantages of functions: Once a function is written, it can be called and used repeatedly as and when required. In structured programming, functions […]

Continue reading

Three dimensional Array

3D array is a combination of several 2D array. For example, marks obtained by a group of students in a class become a 2D array. Now, the marks obtained by several such classes in a school become an example for 3D array.3D array can be created in 2 ways. The first way is to declare […]

Continue reading

Two dimensional Array

A 2D array represents more than one row and column of elements. For example, marks obtained by 3 students in 5 subjects. We can write those marks in 3 rows and 5 columns, as shown here. 2D arrays can be created in two different ways. The first way is to declare the array and later […]

Continue reading

One Dimensional Array

Array: An array is a variable to store a group of elements of the same datatype. An array can hold only one type of element. We can store only integer numbers into an array. We instore only characters into an array. In array we cannot store different types of elements into the same array. For […]

Continue reading

return statements in C

goto statement is used in two ways. The first way is to terminate a function and come back to the calling function. The second way of using return is to return a value to the calling function. Any function contains a group of statements. The general format of a function is shown here: in above […]

Continue reading

goto statement in C

goto statement is useful to directly jump to a particular statement in the program. While executing the statements, suppose we want to directly jump from statement number 1 to statement number 10, We can use goto. Here, LABEL represents a string constant that points to a statement where the compiler should jump. In above example, […]

Continue reading
1 2 3