Variadic function in C: so let’s say you want to add 2 numbers using you own defined function. Here is the code But if the scenario is like you need […]
Function returns multiple values: Way to Return Multiple Values from a C Function
In the previous post, we saw returning a single value from a function. What about a C function returns multiple values? Let’s say we have sent 2 numbers to our […]
Function in C: Function with Inputs and an Output
Function in C: Let’s assume we are going to write a function which takes inputs, and returns an output. To be specific, we will provide 2 integers (input) to our […]
Function in C: Function with No Inputs but an output
So let’s assume we are going to write a function which takes no input, but when it is called it generates a random value and returns it to where it […]
Functions in C: Functions with Inputs but No Return Values
Okay, let’s assume we need to create a function for adding two numbers. We want to add two numbers using a user-defined function. Take a look at 7. Our add() […]
Functions in C: Functions with No Inputs and No Return Value
Up to this point, we are fluent in using printf() and scanf() functions. When they are called they do a specific task for us (printing something on the screen or […]
File handling functions
So far, you have come to know about fopen(), fclose(), fprintf(), fscanf(). Let’s talk about some other functions fputc() and fgetc() Given a string “Hello world”, fputc() is used to […]
Different modes of file operation in C
Modes of file operation So far, we have learned about 2 modes: “r” (for reading) and “w” (for writing). Let’s learn about a few more modes. append “a” Let’s take […]
Read from a File
After we are done with writing into a file, there is no surprise this blog is going to be on how we can read from a file. So let’s get […]
File Handling
Suppose you are given a task to generate average of 50 numbers. So, each time you run the program you have to type 50 numbers from your keyboard and then […]