Write a C program to pass function pointer as parameter to another function. How to pass functions as parameter to another function in C programming.
Write a C program to return multiple value from function. How to return more than one value from function in C programming? Different ways to return multiple value from function in C programming.
Write a C program to multiply two matrix using pointers. How to input and multiply two matrix using pointer in C programming. Logic to multiply two matrix using pointer in C.
Input elements of matrix1: 10 20 30 40 50 60 70 80 90 Input elements of matrix2: 1 2 3 4 5 6 7 8 9
Product of matrices is : 300 360 420 660 810 960 1020 1260 1500
How to access two dimensional array using pointers in C programming? Write a C program to input and print elements of a two dimensional array using pointers and functions.
Input elements in 3x3 matrix: 1 2 3 4 5 6 7 8 9
Elements of 3x3 matrix: 1 2 3 4 5 6 7 8 9
Functions makes our program modular and maintainable. Big applications can have hundreds of functions.
Array is a data structure to store homogeneous collection of data. Arrays are equally important as functions. In programming we often use arrays and functions together.
Here in this post I will explain how to pass and return array from function in C programming.
Write a C program to input elements in an array and sort array using pointers. How to sort an array in ascending or descending order using function pointers in C programming. Logic to sort an array using pointers in program.
Input array elements: 10 -1 0 4 2 100 15 20 24 -5
Array in ascending order: -5, -1, 0, 2, 4, 10, 15, 20, 24, 100, Array in descending order: 100, 24, 20, 15, 10, 4, 2, 0, -1, -5,
Write a C program to input elements in array and search an element in array using pointers. How to search an element in array using pointers in C programming. Logic to search an element in array using pointers in C program.
Input array elements: 10 20 30 40 50 60 70 80 90 100 Input element to search: 25
25 does not exists in array.
In the journey of learning C functions, we learned many concepts related to functions. We learned to define our own function, passing arguments to a function, returning value from a function, recursive function etc. In this chapter, I will talk something interesting about passing variable length arguments to a function.
Have you ever wondered how functions like
scanf() works? As they readily accept any number of arguments passed. You can say -
printf("Learning at Codeforwin"); // Single argument printf("Codeforwin was founded in %d", 2015); // Two arguments printf("Today is %d-%d-%d", 19, 9, 2017); // Four arguments
In real you can pass n number of arguments to
printf(), but how it works?
Recursion is expressing an entity in terms of itself. In C programming, recursion is achieved using functions known as recursive function. Recursive functions are very powerful in solving and expressing complex mathematical problems.
Until now, we called a function from another function. However, C language allows a function to call itself known as Recursive function.
A function is a sub-part of a program that contains a collection of statements grouped together to perform some specific task. Functions in C programming is categorized in two category -