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 readingA 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 in C Once a function is written, it can be called and used repeatedly as and when required. In […]
Continue readingThree dimensional 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. Three dimensional Array can be created in 2 ways. The first way […]
Continue readingA Two Dimensional 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 […]
Continue readingArray: 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 readingReturn 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 […]
Continue readinggoto statement in c 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 […]
Continue readingcontinue statement in c is useful with the next repetition of a loop. When continue inside a loop is executed, the flow of execution goes back to the starting of the loop, and the next repetition will take place, When continue inside a loop is executed, the subsequent statements in the loop are not executed, […]
Continue readingbreak statement in c is used to come out of loop and to come out of switch block. break is also used in conjunction with functions and case statements. Program to understand using break inside loop. Output:
Continue readingThe switch statement in c is useful to execute a particular task from among several tasks depending on the value of a variable or expression.. If the variable value equals value1 then statements1 will be executed. If the variable value equals value2 then statements2 will be executed, etc. If the variable value does not equal […]
Continue reading