• Skip to main content
  • Skip to primary sidebar
  • Skip to secondary sidebar
  • Skip to footer

Computer Notes

Library
    • Computer Fundamental
    • Computer Memory
    • DBMS Tutorial
    • Operating System
    • Computer Networking
    • C Programming
    • C++ Programming
    • Java Programming
    • C# Programming
    • SQL Tutorial
    • Management Tutorial
    • Computer Graphics
    • Compiler Design
    • Style Sheet
    • JavaScript Tutorial
    • Html Tutorial
    • Wordpress Tutorial
    • Python Tutorial
    • PHP Tutorial
    • JSP Tutorial
    • AngularJS Tutorial
    • Data Structures
    • E Commerce Tutorial
    • Visual Basic
    • Structs2 Tutorial
    • Digital Electronics
    • Internet Terms
    • Servlet Tutorial
    • Software Engineering
    • Interviews Questions
    • Basic Terms
    • Troubleshooting
Menu

Header Right

Home » C » C Programming Basic

C Program square and cube of first n natural numbers

By Dinesh Thakur

[Read more…] about C Program square and cube of first n natural numbers

C program to calculate tax, given the following conditions

By Dinesh Thakur

In this tutorial, we can learn C program to calculate tax. In this c program, we enter a number and calculate tax with the given following conditions. [Read more…] about C program to calculate tax, given the following conditions

Conditional Directives in C

By Dinesh Thakur

The conditional directives are meant to control the compilation process. By using them we may conditionally include certain statements of the program for compilation. If the condition is not met the statements are not included. These directives also help us not to include duplicate files in the program and cause error. For example, see the following code: [Read more…] about Conditional Directives in C

Nesting of Macros in C

By Dinesh Thakur

A macro may be used in the definition of another macro as illustrated below. [Read more…] about Nesting of Macros in C

Preprocessor Directive #define

By Dinesh Thakur

Macros may also be created by #define. Here the identifier can have parameters but types of parameters are not mentioned. [Read more…] about Preprocessor Directive #define

Preprocessor operator ##.

By Dinesh Thakur

The token # single in its own line is null directive. It is simply neglected by compiler. Thus, if the code is simply as given below, it is neglected by the compiler. [Read more…] about Preprocessor operator ##.

#define and #undef preprocessor directives

By Dinesh Thakur

The directive #define is used to create symbolic constants and macros (small function type entities). The directive #define may be used in the following manner: [Read more…] about #define and #undef preprocessor directives

Function strftime () in C

By Dinesh Thakur

The syntax of the function is as follows:

size_t strftime(char* s, size_t maxsize, const char* format, const struct tm * Tmptr);

The function strftime () formats the broken-down time tm into an array pointed to by s according to the specified formatting string pointed to by format. The size of array is limited by maxsize. The formatting string consists of 0 or more conversion Specifiers and ordinary characters. The ordinary characters placed in the formatting string are copied into s without any conversion. Each specifier consists of a percent character(%) followed by a character that determines the action of conversion specifier. Some conversion Specifiers may have an additional modifier character E or 0 placed between% symbol and the conversion specifier character. The strftime() function returns the number of characters placed in the arrays, not including the terminating Null character.

Illustrates application of function strftime (). [Read more…] about Function strftime () in C

Function asctime () in C

By Dinesh Thakur

The syntax of the function asctime () is written as follows: [Read more…] about Function asctime () in C

Function ctime () in C

By Dinesh Thakur

The function prototype of ctime () is written in the following manner: [Read more…] about Function ctime () in C

Function localtime () in C

By Dinesh Thakur

The function localtime () converts the calendar time, i.e., the output of function time (), into a broken-down time expressed as local time, and returns the pointer to broken-down time. If the conversion into local time fails, the function returns NULL pointer. The prototype of the function is written in the following manner: [Read more…] about Function localtime () in C

Function mktime () in C

By Dinesh Thakur

The prototype of the function is written as given below, [Read more…] about Function mktime () in C

Function difftime () in C

By Dinesh Thakur

The function difftime ()returns the difference between two calendar times in seconds, i.e., number of seconds elapsed between two calendar times time2 and time]. The calendar time represents the time elapsed since 00:00:00 hours 01 January 1970, GMT. The function returns the difference in seconds as a double number. The function prototype is written as follows: [Read more…] about Function difftime () in C

Function time () in C

By Dinesh Thakur

The function time () returns the current calendar time, i.e., the number of seconds elapsed since 00:00:00 hour January 1, 1970 GMT (or gmt are used alternatively) up to the execution of the function. The function prototype is written as follows: [Read more…] about Function time () in C

Function clock () in C

By Dinesh Thakur

The clock function is used to determine the processor time in executing a program or part of a program. The header file <time.h> should be included in the program for its application. The function prototype is given below. [Read more…] about Function clock () in C

Error-Handling functions in C

By Dinesh Thakur

Function clearerr () [Read more…] about Error-Handling functions in C

Function putw()and getw() in C

By Dinesh Thakur

Function putw() [Read more…] about Function putw()and getw() in C

Appending Text in a File in C

By Dinesh Thakur

Appending to a file means adding at the end of the file while keeping the previous contents of the file intact. For this the file open mode is “a”. Program illustrates appending a file. [Read more…] about Appending Text in a File in C

Function ungetc() in C

By Dinesh Thakur

The function prototype is written in the following manner: [Read more…] about Function ungetc() in C

Function remove() in C

By Dinesh Thakur

The prototype of this function is given below. [Read more…] about Function remove() in C

Function rename () in C

By Dinesh Thakur

This function is used to change the name of file. Its prototype may be written as given below. [Read more…] about Function rename () in C

Function freopen () in C

By Dinesh Thakur

This function may be used for opening a file in different modes. The function prototype may be written in the following manner: [Read more…] about Function freopen () in C

void Pointers in C

By Dinesh Thakur

The assignment operator (=) may be used on pointers of the same type. However, if the types of pointers (types of variables to which they point) are not same then we will have to do type casting of one of these to the type of the other to use assignment operator. However, the void pointer (void * ) can represent any pointer type. Thus, any type of pointer may be assigned to a void pointer. However, the reverse is not valid. A void pointer cannot be assigned to any other type of pointer without first converting the void pointer to that type. [Read more…] about void Pointers in C

typedef for Pointers to Functions in C

By Dinesh Thakur

We may make use of typedef for declaring pointers to functions. Examine the following code: [Read more…] about typedef for Pointers to Functions in C

Pointer to Functions as Parameter in C

By Dinesh Thakur

A function may have another function as one of its parameters besides having parameters of other data types. A function is a derived type object; its type is derived from the type of data it returns. Like arrays, the name of a function also holds the address of the function. [Read more…] about Pointer to Functions as Parameter in C

Pointer to Three-Dimensional Arrays in C

By Dinesh Thakur

If elements of an array are two-dimensional arrays, the array is called a three-dimensional array. Therefore, a three-dimensional array may be considered as an array of matrices. Let Arm be a 3-dimensional array or an array of matrices. The declaration of pointer and its initialization is carried out as given below. [Read more…] about Pointer to Three-Dimensional Arrays in C

Manipulation of Complex Numbers by Structures

By Dinesh Thakur

A complex number is also a multivalue object. It consists of two parts: real part and imaginary part. The imaginary part carries symbol i which is equal to √-1 . A complete number is written as sum of the real part and the imaginary part as shown below. [Read more…] about Manipulation of Complex Numbers by Structures

Vectors with Structures in C

By Dinesh Thakur

Since structures are multivalue, multitype data objects, they can be considered to form a useful tool in manipulation of quantities such as vectors, complex variables, etc. For this we define functions of the type struct, i.e., the return value of the function is a structure. The function may have arguments of type struct besides other arguments. Let us define a structure with three components of vector as its data members as shown below. [Read more…] about Vectors with Structures in C

Sorting of Structures in C

By Dinesh Thakur

When structures are used to keep record of employees, students, and so on, we would need to sort them according to some criterion. For employees, it may be according to alphabetical order, designation, or pay. [Read more…] about Sorting of Structures in C

C Program to Structure as a Parameter of Functions

By Dinesh Thakur

Program provides an illustration of a function with structure as one of its parameter. The function calculates and returns the magnitude of a vector which is an instance of structure defined to hold the three components of a vector as its data members. The structure is declared as below. [Read more…] about C Program to Structure as a Parameter of Functions

« Previous Page
Next Page »

Primary Sidebar

C Programming

C Programming Tutorials

  • C - History
  • C - Anatomy
  • C - Constants
  • C - Identifiers
  • C - Data Types
  • C - Libraries File
  • C - Header Files
  • C - Basic Language
  • C - Data Types Sizes
  • C - Header Files Importance
  • C - Escape Sequences
  • C - Main() Purpose
  • C - Program Procedure
  • C - Control Statements
  • C - Enumeration Constant
  • C - Add numbers
  • C - Return Statement
  • C - Avoid Goto
  • C - Command Line Arguments
  • C - Switch Case
  • C - Switch Case Limitations
  • C - getchar() and putchar()
  • C - Iteration Statements
  • C - Pass by Value and Reference
  • C - Structures and Unions
  • C - Structure
  • C - Dynamic Memory
  • C - Fgets and Fputs Functions
  • C - Gets() and Puts() Functions
  • C - Armstrong Number
  • C - Storage Classes
  • C - Fibonacci Series
  • C - Precision Setting
  • C - const Parameters

C - Variable & It's Type

  • C - Variables
  • C - Variable Lifetime
  • C - Static Variable
  • C - Register Variable
  • C - Global Variables
  • C - Auto Variables
  • C - Local Variables

C - Operator & Expressions

  • C - Operator
  • C - Boolean Operators
  • C - Bitwise Operator
  • C - Arithmetic Operators
  • C - Modulus Operator
  • C - Ternary Operator
  • C - Expressions
  • C - Arithmetic Expressions

C - Array

  • C - Arrays
  • C - Array Types
  • C - Array Characteristics
  • C - Static Arrays
  • C - Global Arrays
  • C - 3D Arrays
  • C - Dynamic Arrays
  • C - Pointer to 3D Arrays
  • C - Array Elements Hold
  • C - Arrays as Function Parameters
  • C - Accessing Matrix Elements
  • C - File Handling
  • C - Matrix Multiplication
  • C - Dynamic Memory Allocation

C - Searching & Sorting

  • C - Data Structures
  • C - Linear Search
  • C - Bubble Sort
  • C - Merge Sort
  • C - Linked List
  • C - Insertion Sort
  • C - Binary Search
  • C - Selection Sort
  • C - Quick Sort

C - Functions

  • C - Functions
  • C - Functions Advantages
  • C - Void Functions
  • C - Function Call
  • C - Default Return Value
  • C - String functions

C - Pointer

  • C - Pointers
  • C - Type Casting Of Pointers
  • C - Pointer Advantages
  • C - Pointers Initialization
  • C - Vectors and Pointers

C - Differences

  • C - C Vs C++
  • C - Formal Args. Vs Actual Args.
  • C - Keywords Vs Identifiers
  • C - Strings Vs Character Arrays
  • C - Address Vs Dereference Operator
  • C - Goto Vs longjmp
  • C - Declaring Vs Defining Variable
  • C - String Vs Array
  • C - Call by Value Vs Reference
  • C - Structure Vs Union
  • C - For Vs While loops
  • C - Compiler Vs Interpreter

C - Programs

  • C Program Standard Deviation
  • C Program Calculate Tax
  • C Program Sum Series
  • C Program Merge Arrays
  • C Program Euclid’s Algorithm
  • C Program Print Weekdays
  • C Program Sum of Digits
  • C Program Print a list
  • C Program Print Pythagorean
  • C Program Quiz program
  • C Program Display Table
  • C Program Print Comma-Separated
  • C Program Prints Prime Numbers
  • C Program for Print Integer
  • C Program Count Number
  • C Program Print Color Name
  • C Program Print Odd Numbers
  • C Program Calculate area
  • C Program for a Menu
  • C Program Add Two Vectors
  • C Program Array Addresses
  • C Program Division by Zero Error
  • C Program Compare two Dates
  • C Program Tower of Hanoi
  • C Program return 3 Numbers
  • C Program for Prime Numbers
  • C Program for Factorial
  • C Program for Palindrome

Other Links

  • C Programming - PDF Version

Footer

Basic Course

  • Computer Fundamental
  • Computer Networking
  • Operating System
  • Database System
  • Computer Graphics
  • Management System
  • Software Engineering
  • Digital Electronics
  • Electronic Commerce
  • Compiler Design
  • Troubleshooting

Programming

  • Java Programming
  • Structured Query (SQL)
  • C Programming
  • C++ Programming
  • Visual Basic
  • Data Structures
  • Struts 2
  • Java Servlet
  • C# Programming
  • Basic Terms
  • Interviews

World Wide Web

  • Internet
  • Java Script
  • HTML Language
  • Cascading Style Sheet
  • Java Server Pages
  • Wordpress
  • PHP
  • Python Tutorial
  • AngularJS
  • Troubleshooting

 About Us |  Contact Us |  FAQ

Dinesh Thakur is a Technology Columinist and founder of Computer Notes.

Copyright © 2025. All Rights Reserved.

APPLY FOR ONLINE JOB IN BIGGEST CRYPTO COMPANIES
APPLY NOW