C Program find whether a Number is Prime Or Composite using Recursion

prime number

C Program find whether a Number is Prime Or Composite using Recursion Prime Number: A number that is only divisible by 1 and itself. Composite Number: A number that is not a prime number. Note: 1 is neither prime nor composite. Below is a program to find whether the user input number is a prime number or a … Read more

C program to print digital clock with current time

#include <stdio.h> #include <time.h>   int main() {     time_t s, val = 1;     struct tm* current_time;        s = time(NULL);        current_time = localtime(&s);       printf(“%02d:%02d:%02d”,            current_time->tm_hour,            current_time->tm_min,            current_time->tm_sec);       return 0; }

Pointers in C Programming

A pointer is a variable that stores the address of another variable. Unlike other variables that hold values of a certain type, pointer holds the address of a variable. For example, an integer variable holds (or you can say stores) an integer value, however an integer pointer holds the address of a integer variable. In … Read more

Structure in C programming

Structure is a group of variables of different data types represented by a single name. Lets say we need to store the data of students like student name, age, address, id etc. One way of doing this would be creating a different variable for each attribute, however when you need to store the data of … Read more

Function call by reference in C Programming

Before we discuss function call by reference, lets understand the terminologies that we will use while explaining this: Actual parameters: The parameters that appear in function calls. Formal parameters: The parameters that appear in function declarations. For example: We have a function declaration like this: int sum(int a, int b); The a and b parameters … Read more

Functions in C Programming

A function is a block of statements that performs a specific task. Suppose you are building an application in C language and in one of your program, you need to perform a same task more than once. In such case you have two options – a) Use the same set of statements every time you … Read more

Strings and String functions in c

String is an array of characters. In this post, we learn how to declare strings, how to work with strings in C programming and how to use the pre-defined string handling functions. We will see how to compare two strings, concatenate strings, copy one string to another & perform various string manipulation operations. We can … Read more

Two dimensional (2D) arrays in C programming

An array of arrays is known as 2D array. The two dimensional (2D) array in C programming is also known as matrix. A matrix can be represented as a table of rows and columns. Initialization of 2D Array There are two ways to initialize a two Dimensional arrays during declaration. int disp[2][4] = { {10, … Read more

Arrays in C programming

An array is a group (or collection) of same data types. For example an int array holds the elements of int types while a float array holds the elements of float types. How to declare Array in C int num[35];  /* An integer array of 35 elements */ char ch[10];  /* An array of characters … Read more

goto statement in c programming

The goto statement is rarely used because it makes program confusing, less readable and complex. Also, when this is used, the control of the program won’t be easy to trace, hence it makes testing and debugging difficult. goto statement When a goto statement is encountered in a C program, the control jumps directly to the … Read more