## C Program to Multiply two Floating Point Numbers

Given two floating numbers A and B. The task is to write a program to find the product of these two numbers. Examples: Input: A… Read More »

## C Program to Compute Quotient and Remainder

Given two numbers A and B. The task is to write a program to find the quotient and remainder of these two numbers when A… Read More »

## C program to Find the Largest Number Among Three Numbers

Given three numbers A, B and C; The task is to find the largest number among the three. Examples: Input: A = 2, B =… Read More »

## C program to find the size of int, float, double and char

Given four types of variables, namely int, char, float and double. The task is to write a program to find the size of these four… Read More »

## C program to Check Whether a Number is Positive or Negative or Zero

Given a number A. The task is to check whether A is positive, negative or zero. Examples: Input: A = 2 Output: 2 is positive… Read More »

## ctime() Function in C/C++

The ctime() function is define in the time.h header file. The ctime() function returns the string representing the localtime based on the argument timer. Syntax:… Read More »

## time() function in C

The time() function is defined in time.h (ctime in C++) header file. This function returns the time since 00:00:00 UTC, January 1, 1970 (Unix timestamp)… Read More »

## Generic Implementation of QuickSort Algorithm in C

Write a function to implement quicksort algorithm that will work for all types of data i.e ints, floats, chars etc. It should accept all types… Read More »

## C Program to Add two Integers

Given two numbers A and B. The task is to write a program to find the addition of these two numbers. Examples: Input: A =… Read More »

## How to return multiple values from a function in C or C++?

New programmers are usually in the search of ways to return multiple values from a function. Unfortunately, C and C++ do not allow this directly.… Read More »

## Program to Find the Largest Number using Ternary Operator

The task is to write a program to find the largest number using ternary operator among: Two Numbers Three Numbers Four Numbers Examples: Input :… Read More »

## How to avoid Structure Padding in C?

Prerequisites: Structure Member Alignment, Padding and Data Packing In Structure, sometimes the size of the structure is more than the size of all structures members… Read More »

## C Program to Check Whether a Number is Prime or not

Given a positive integer . The task is to write a C program to check if the number is prime or not. Definition: A prime… Read More »

## C program to invert (making negative) an image content in PGM format

Given an image in PGM format and the task is to invert the image color (making negative) content in PGM format. Prerequisite: c-program-to-write-an-image-in-pgm-format PGM image… Read More »

## getopt() function in C to parse command line arguments

The getopt() function is a builtin function in C and is used to parse command line arguments. Syntax: getopt(int argc, char *const argv[], const char… Read More »