• 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

Block Statements in the if Statement

By Dinesh Thakur

Often we wish to perform more than one operation when the condition in an if statement evaluates as true and/or false as shown in Fig. In such situations, we use block statements (also called compound statements) within the if statement.

When both alternative statements in the general format of an if-else statement (i. e., statement1 and statement2) are block statements, the if-else statement may be written in one of the styles given below:

             Flowchartsfor if statements containing more than one statements in if and/or else blocks

           

If expression expr is true (i.e., non-zero), statements within the if block are executed in the given sequence; otherwise statements in the else block are executed. The flowchart for this statement is given in Fig. a. Note that the statements within the if and else blocks are indented to improve readability. Also, observe the style of using opening braces in a block. In first style, it is written on a line by itself, whereas in second style, it is written on the line containing the if and else keywords. Both styles are commonly used. The second style is used in this book mainly because it saves space.

If statement 1 or statement2 (but not both) in the if-else statement is a block statement, we get two other forms of if-else statements as shown below.

           other forms of if-else statements

Similarly, we can replace statement] in a simple if statement with a block statement as

if (expr) {

statement1 a ;

statement1 b ;

…….

}

The flowchart for this simple if statement is given in Fig. b. Finally note that when the if block and else block contain a single statement, curly braces are not required. However, programmers often use such braces as shown below:

if (expr) {

statement1;

}

else {

statement2;

}

This form requires more lines, however, it simplifies the addition of one or more statements in if and/or else blocks and also prevents introduction of difficult to trace bugs when such statements are added without braces.

Illustrates if-else expression.

#include<stdio.h> 
 
void main()
 
{
 
   int A, B;
 
   clrscr();
 
   printf("Enter two integers:");
 
   scanf("%d %d",&A,&B);
 
   if (A % B)
 
      printf("A is not divisible by B.\n");
 
   else
 
      printf("A is divisible by B.\n");
 
}

Relational and Equality Operators

By Dinesh Thakur

The C language provides four relational and two equality operators for comparing the values of expressions. The relational operators are less than (<), greater than (>), less than or equal to (<=) and greater than or equal to (>= ). The equality operators are equal to (==) and not equal to ( ! =). These operators are binary infix operators, i. e., they are used in the form a op b, where a and bare operands (constants, variables or expressions) and op is a relational or an equality operator. Table summarizes these operators. [Read more…] about Relational and Equality Operators

Ternary Operator in C

By Dinesh Thakur

The conditional expression operator (?:) is the only ternary operator in C language. It takes three operands and is used to evaluate one of the two alternative expressions depending on the outcome of a test expression. The controlling condition of the ternary operator must evaluate to boolean, either true or false . If the condition is true , the ternary operator returns expr1 , otherwise it returns the expr2 . [Read more…] about Ternary Operator in C

Program Termination Functions

By Dinesh Thakur

The exit function can be used to terminate program execution and return a specified value as program status to the calling program, usually the operating system. A zero value indicates success. An example of the exit function indicating unsuccessful termination of a program is shown below.

exit (1);

The abort function, on the other hand, is used to abnormally terminate the program. This function displays a message “Abnormal Program termination” and exits the program. A typical call to this function takes the following form:

abort();

Random Number Generation function

By Dinesh Thakur

Random number generation is a very useful facility in many programming situations, particularly gaming and simulation. We can also use it to generate test data for programs, particularly when a large amount of data is required. This saves a lot of time on data entry.

A random number is one whose value cannot be predicted. It is nearly impossible to get truly random numbers. However, one may use pseudorandom numbers which are generated. The C standard library provides a function named rand to generate pseudo-random numbers. This function is declared in the stdlib.h header file. It does not require any argument and returns an integer number in the range 0 to RAND_MAX, where RAND_MAX is a constant defined in stdlib.h with value 32767.

We can manipulate the value returned by the the rand function to generate integer or floating-point numbers in a desired range. The expression

(float) rand() / RAND_MAX

gives a random number of type float in the range [0.0, 1.0], i. e., 0 to 1.0, both inclusive. Note the use of typecast (float) to avoid integer division. To generate a random number in a desired range m ton, we can now use the following expression:

m + (m – n) * (float) rand() /RAND_MAX

The rand function actually generates pseudo-random data. Thus, each time the program is executed, it generates the same sequence of random numbers. This may not be acceptable in many situations. Hence, another function called srand is provided to reseed the random number generator. A typical call to this function takes the following form:

srand (seed)

where seed is an unsigned integer. This call reseeds the random number generator so that a different sequence of random numbers is generated on subsequent calls to rand.

Random numbers generation with rand() with default seed.

#include<stdio.h>
#include<stdlib.h>
int main ()
{
  int n ;
  clrscr();
  for (n=1; n< 7; n++)
  printf("%d\t",rand());
  return 0;
}

The output of first trial is as below

     

The result of second trial is same as that of first as given below

     

Note that the two sets of random numbers are identical. In fact every time the function rand ()is used without changing the seed number, it will produce same set of random numbers. In order to get a different single or set of random numbers a different seed number has to be provided through function srand ().Program  provides an illustration of generating one random number with the same seed numbers.

Random number generation with same seed number

#include<stdio.h>
#include<stdlib.h>
int main()
{
  unsigned seed;
  int n ;
  clrscr();
  seed = 1;
  for (n=1;n< 4;n++)
   {
     srand(seed);
     printf("%d\t",rand()) ;
   }
     printf ("\n");
     return 0;
}

The expected output is as given below

      

The output illustrates that if the seed number is 1 then the random number generated is 346. This is also called default seed number; when a user does not provide a seed number, the system provides 1 as the seed number.

When a set of random numbers is generated, for the first number, the system provides 1 as the seed number and the random number generated is used as the seed for the next random number. Program computes rand () with a seed number provided by the user of the program. Therefore, for every application of rand () a different seed number is required to produce a different random number. That is, while producing a set of random numbers, if the first random number is different, then the whole set would be different.

Illustrates random number generation with a seed number

#include<stdio.h> 
#include<stdlib.h>
int main()
{
  int n , S;
  clrscr();
  printf("Enter an integer seed number : ");
  scanf("%d", &S);
  srand(S);
  for (n=1;n<=6;n++)
  printf("%d\t", rand());
 return 0;
}

The output is as given below.

 

Converting Strings to Numbers

By Dinesh Thakur

The atoi, atof and atol utility functions are used to perform string to numeric conversion. As indicated by the last letter in function names, these functions convert the argument string to an integer, floating and long number. Note that the argument string should contain a number of appropriate type as text, optionally preceded by whitespace. For example, the atof function can successfully convert strings such as” 1.23″, “3.21El0”, etc. The conversion stops when an inappropriate character is encountered in the input string. Thus, these functions will also be able to convert strings such as “-1. 23ABC”, “3. 21E10ABc”. If conversion is successful, these functions return the converted value, otherwise zero.

The atoi and atol functions convert the argument string to an integer number of type int and long int, respectively. The initial portion of the string should contain an integer number in the decimal format ±ddd, in the range of data type being converted to (i.e., int or long int).

The atof function, on the other hand, converts the argument string to a floating number of type double. The initial portion of the string should contain a floating number in either decimal or scientific notation, in the range of type double.

How Convert Lower Case (strlwr) String to Upper case (strupr) String

By Dinesh Thakur

Another commonly required string operation is that of converting the case of a given string. The C standard library does not provide any function for case conversion. However, some C implementations provide the strlwr and strupr functions. The strlwr function converts all characters in a given string to lowercase, whereas the strupr function converts all characters to uppercase. Typical calls to these functions take the following forms:

strlwr (s);

strupr (s);

Note that these functions modify the string passed as an argument and return a pointer to the modified string. The program segment given below converts (and prints) a string to uppercase and lowercase representations.

char str[] = “EVERYTHING is fair in LOVE and WAR”;

printf(“Uppercase: %s\n”, strupr(str));

printf(“Lowercase: %s\n”, strlwr(str));

The output of this program segment is shown below.

Uppercase: EVERYTHINGIS FAIR IN LOVE AND WAR

Lowercase: everything is fair in love and war

How to use strlen () (String Length) work.

By Dinesh Thakur

The length of a string is defined as the number of characters in it excluding the null terminator. The strlen function returns the length of a specified string. A typical call to this function takes the following form:

strlen (s)

For example, the program segment given below determines the length of a string using thestrlen function and prints it.

char str[] = “EVERYTHING is fair in LOVE and WAR”;

printf(“Length : %d\n”, strlen(str));

Illustrates below strlen ( ).

#include<stdio.h>
#include <string.h>
void main ()
{
char S1[ ] = "ABCDE";
char S2 [] = "A";
char S3 [] = "Z";
char S4[] ="Dinesh,";
char S5[30];
char S6[] = "Good morning !";
clrscr();
printf("Length of string S1 = %d\n", strlen(S1));
printf("Length of string S6 = %d\n", strlen(S6));
printf("Comparison of S2 with S3 = %d\n", strcmp(S2,S3));
printf("Comparison of S3 with S2 = %d\n", strcmp(S3,S2));
printf ("Comparison of S3 with Z = %d\n", strcmp (S3,"Z"));
strcat (S4, S6);
printf("S4 = %s\n", S4);
strcpy(S5, S4);
printf("S5 = %s\n", S5);
}

How to Formatted Output using the printf Function

By Dinesh Thakur

The printf function allows the values of argument expressions to be printed in various formats. A large number of conversion characters are provided for printing expressions of different types. Also, the possibility of using several optional fields along with these conversion characters makes printf a very powerful and complicated function. [Read more…] about How to Formatted Output using the printf Function

What is Function Prototypes?

By Dinesh Thakur

A standard C header file contains the declarations or prototypes of functions of a particular category. A function ‘prototype usually specifies the type of value returned by that function, the function name and a list specifying parameter types as

                  ret_type func_name ( type1 , type2, … ) ;

where func_name is the name of the function, ret_type is the type of value returned by it and typel, type2, … are the types of first, second, … function parameters. Note that the parameter type list is comma separated and is enclosed within a pair of parentheses. It specifies the number of arguments required in function calls and the type of each argument. When a function is called, an argument of appropriate type must be specified for each of the parameter types specified in the function prototype.

We can either omit the parameter type list or use thevoid keyword in its place to indicate that the function does not have any parameters, i. e., it does not require any arguments. In addition, the void keyword may be used as the function return type to indicate that the function does not return any value. However, note that if the return type is omitted, the function is assumed to return a value of typeint.

A function prototype may also contain the parameter names as shown below:

ret_type func_name (type1 param1, type2 param2, … );

where param1 is the name of first parameter, param2 is the name of the second parameter and so on. The inclusion of parameter names in function prototypes clarifies the order in which arguments are to be specified in a function call.

Example of Function Prototypes

For example, the prototypes of thesqrt andpow standard library functions are given below.

double sqrt(double);

double pow(double, double);

Thesqrt function returns the square root of the argument expression specified in its call. It accepts one argument of typedouble and returns a value of typedouble.On the other hand, thepow function which calculates xY accepts two arguments of typedouble and returns a value of typedouble. This prototype can also be written using parameter names as

double pow(double x, double y);

Now consider the prototypes for thegetmaxx andsetcolor functions given in thegraphics.h header file of Turbo C/C++.

int getmaxx(void);

void setcolor(int color);

Observe that thegetmaxx function does not accept any argument and thesetcolor function does not return any value.

Illustrates declaration of function prototype. (Function definition is given below the main function).

#include<stdio.h> 
int Cube (int); // Prototype of function Cube()
int Square(int); //prototype of function Square()
main()
{
  int A;
  clrscr();
  printf("Number\t Square\t Cube\n" );
  for( A= 1;A <=4 ;A++)
    printf("%d\t %d\t %d\n", A, Square(A), Cube (A) );
  return 0;
}
int Cube (int x) // Definition of function Cube()
  {return x*x*x;}
int Square (int y) // Definition of function Square()
  {return y*y;}

In the above program, two functions are defined: One returns the square of its argument and the other returns cube of its argument. They are called in the printf()function in main to return the respective values for numbers 1 to 4 which are printed in the output.

Program is another example in which the function prototype has been declared before main and function definition is given after main().

What is Streams?

By Dinesh Thakur

The devices used with a computer, such as a keyboard, monitor, printer, hard disk, magnetic tape, etc., have widely varying properties regarding data input and output. To simplify data I/O operations, the C standard library supports a simple mode of input and output based on the concept of a stream. [Read more…] about What is Streams?

Trigonometric and Hyperbolic Functions

By Dinesh Thakur

The trigonometric and hyperbolic functions provided in the standard mathematical library are listed in Table. Except for the atan2 function, which takes two arguments, all other functions take a single argument and each function returns a single value. Note that the function parameters and return values are of type double.

The sin, cos and tan functions are used for the evaluation of sine, cosine and tangent, respectively, of a given angle, which must be specified in radians.

The asin, acos and atan functions return arc sine (i. e., sin-1), arc cosine (i. e., cos-1) and arc tangent (i.e., tan-1), respectively. The function call atan2 (y, x) returns the arc tangent of y/x. The angle returned by these functions is in radians. Note that the argument of the asin and acos functions must be in the range -1.0 to 1.0, both inclusive; otherwise, they give domain error. Similarly, the argument of atan function must be in the range -π/2 to π/2. The functions sinh, cosh and tanh are used to calculate the hyperbolic sine, hyperbolic cosine and hyperbolic tangent, respectively.

Table  Trigonometric and hyperbolic functions in the standard library of the C language

Function Name

Typical call

Explanation

Function prototype

sin

sin(x)

sine of x

double sin(double x)

cos

cos (x)

cosine of x

double cos(double x)

tan

tan(x)

tangent of x

double tan(double x)

asin

asin(x)

sin-1(x) in range [-π/2,π/2],x∑[-1, 1]

Double asin(double x)

acos

acos(x)

cos-1(x) in range[0,π], x ∑ [-1, 1]

double acos(double x)

atan

atan(x)

tan-1(x) in range [-π/2, π/2]

double atan(double x)

atan2

atan2 (y, x)

tan–1 (y/x) in range [-π,π]

double atan2(double y, double x)

sinh

sinh (x)

hyperbolic sine of x

double sinh(double x)

cosh

cosh(x)

hyperbolic cosine of x

double cosh(double x)

tanh

tanh(x)

hyperbolic tangent of x

double tanh(double x)

 

While using functions in this group, we may have to convert the angles between degrees and radians. These conversions are given as θr=(π/180) θd and θd=(180/π)θr, where θd  and θr are angles in degrees and radians, respectively.

Illustrates evaluation of trigonometric functions

#include <stdio.h>
#include <math.h>
int main ()
{
  int A, i ;
  double pi = 3.14159, C,S,T,ARad, theta;
  clrscr();
  printf("Angle A\t\tcos(A)\t\tsin(A)\t\ttan(A)\ndegrees\n");
  for ( i =0; i<4; i++)
    {
      A = 60*i;
      ARad = A*pi/180; //converting angle from degrees to radians.
      C =cos (ARad); //calling trigonometric functions
      T = tan (ARad);
      S = sin (ARad);
      printf("%d\t\t%4.3lf,\t\t%4.3lf\t\t%4.3lf\n",A, C,S,T);
    }
      theta= asin(.5)*180/pi; // conversion of radians into degrees
      printf("sin inverse of .5 = % 3.3lf degrees\n", theta);
      return 0;
}   

The output of sine, cosine, and tangent of different values of angle are given in tabular form. For evaluation of functions sin(), cos(), etc. the angle should be converted into radians. The return values of inverse trigonometric functions such as acos(), asin(), etc., are also in radians. These values may be converted into degrees if so needed. In the above results sin-1(.5) is evaluated in radians and converted to 30 degrees. However, if it is put as asin(l/2) the result may come out to be 0.0 because 1/2 is integer division with value 0.

gets() and puts() Functions

By Dinesh Thakur

We can read a string using the %s conversion specification in the scanf function. However, it has a limitation that the strings entered cannot contain spaces and tabs. To overcome this problem, the C standard library provides the gets function. It allows us to read a line of characters (including spaces and tabs) until the newline character is entered, i. e., the Enter key is pressed. A call to this function takes the following form: [Read more…] about gets() and puts() Functions

getchar() and putchar()

By Dinesh Thakur

The standard C library provides several functions and macros for character 1/0. Here we consider the getchar and putchar macros. As these macros read or write a single character, they are typically used in a loop to read/write a sequence of characters. [Read more…] about getchar() and putchar()

Formatted Input – the scanf Function

By Dinesh Thakur

The scanf standard library function is used to read one or more values from the standard input (keyboard) and assign them to specified variables. A typical call to the scanf function takes the following form: [Read more…] about Formatted Input – the scanf Function

Formatted Output – the printf Function

By Dinesh Thakur

The printf (print formatted) standard library function is used to print the values of expressions on standard output (i. e., display) in a specified format. A typical call to the printf function takes the form of a C statement as [Read more…] about Formatted Output – the printf Function

What is Function Call in C Language?

By Dinesh Thakur

A function is a subprogram that is used to perform a predefined operation and optionally return a value. Using functions, we can avoid repetitive coding in programs and simplify as well as speed up program development. [Read more…] about What is Function Call in C Language?

What is Header Files in C?

By Dinesh Thakur

The C standard library provides the executable code and declarations for functionality provided in it. The executable code for the library is provided in separate files, usually in the lib directory, in the installation directory of the compiler. The library files in Turbo C/C++ are named *.LIB, whereas those in the MinGW compiler provided with Dev-C++ and Code :: Blocks are named lib*. a. [Read more…] about What is Header Files in C?

Arithmetic Expressions in C

By Dinesh Thakur

An arithmetic expression contains only arithmetic operators and operands. We know that the arithmetic operators in C language include unary operators (+ – ++ — ), multiplicative operators (* / %) and additive operators (+ – ). The arithmetic operands include integral operands (various int and char types) and floating-type operands (float, double and long double). [Read more…] about Arithmetic Expressions in C

What is Arithmetic operator in C language?

By Dinesh Thakur

Arithmetic operators are used to perform arithmetic operations on arithmetic operands, i. e., operands of integral as well as floating type. Recall that an integral type includes all forms of char and int types, whereas the floating-point types include the float, double and long double types. These operations include addition (+), subtraction (- ), multiplication (*), division (!), modulo arithmetic (%), increment (++), decrement (– ), unary plus (+) and unary minus (- ). They can be grouped into three categories: unary operators, multiplicative operators and additive operators. The arithmetic operators are summarized in Table. [Read more…] about What is Arithmetic operator in C language?

What is Precedence and Associativity of Operators?

By Dinesh Thakur

The operator precedence and associativity rules specify the order in which operators in an expression are bound to the operands. These rules enable us to interpret the meaning of an expression in an unambiguous manner. [Read more…] about What is Precedence and Associativity of Operators?

What is Operators in C language?

By Dinesh Thakur

Operators are used to connect operands, i. e., constants and variables, to form expressions. [Read more…] about What is Operators in C language?

What is Basic Language (beginner’s all-purpose symbolic instruction code,)?

By Dinesh Thakur

BASIC stands for beginner’s all-purpose symbolic instruction code, and is a computer programming language that was invented in 1964 at Dartmouth University by John G Kemeny and Thomas E Kurtz. BASIC has the advantage of English-like commands that are easier to understand and remember than those of most other languages. Even so, the latest versions of BASIC can do just about anything programming languages like C or Pascal can do. [Read more…] about What is Basic Language (beginner’s all-purpose symbolic instruction code,)?

Write a C program for a menu driven program which has following options:

By Dinesh Thakur

1. Factorial of a number.
2. Prime or not
3. Odd or even
4. Exit

Once a menu item is selected the appropriate action should be taken and once this action is finished, the menu should reappear. Unless the user selects the ‘Exit’ option the program should continue to work.  [Read more…] about Write a C program for a menu driven program which has following options:

Find the efficiency of the worker.

By Dinesh Thakur

 

 

Write a C program in a company, worker efficiency is determined on the basis of the time required for a worker to complete a particular job. If the time taken by the worker is between 2 - 3 hours, then the worker is said to be highly efficient. If the time required by the worker is between 3 - 4 hours, then the worker is ordered to improve speed. If the time taken is between 4 - 5 hours, the worker is given training to improve his speed, and if the time taken by the worker is more than 5 hours, then the worker has to leave the company. If the time taken by the worker is input through the keyboard, find the efficiency of the worker. 
 
#include<stdio.h>
#include<conio.h>
void main()
{
float hours;
clrscr();
printf("Enter the number of hours worker takes to finish the job:");
scanf("%f",&hours);
if(hours>=2&&hours<=3)
printf("\nWorker is highly efficient");
else
{
if(hours>=3&&hours<= 4)
printf("\nWorker is ordered to improve his efficiency");
else
{
if(hours>=4&&hours<=5)
printf("\nWorker should be given training to improve his efficiency");
else
printf("\nWorker should leave the company");
}
}
printf("\nPress any key to exit.");
getch();
}
 
OUTPUT:
 
Enter the number of hours worker takes to finish the job: 4
Worker is ordered to improve his efficiency
Press any key to exit.

Write a C Program to Display a Table of Squares and Cubes

By Dinesh Thakur

In this example, the initial and final loop variable i (of type int) are 1 and 10, respectively. The increment expression, i += 1, increases the value of i by 1. Thus, i assume values 1, 2, 3, 4, and 5.

[Read more…] about Write a C Program to Display a Table of Squares and Cubes

String Processing — Write out a function that prints out all the permutations of a String. For example, abc would give you abc, acb, bac, bca, cab, cba.

By Dinesh Thakur

[Read more…] about String Processing — Write out a function that prints out all the permutations of a String. For example, abc would give you abc, acb, bac, bca, cab, cba.

How can I convert a String to a Number

By Dinesh Thakur

The standard C library provides several functions for converting strings to numbers of all formats (integers, longs, floats, and so on) and vice versa. [Read more…] about How can I convert a String to a Number

How can I convert a Number to a String

By Dinesh Thakur

The standard C library provides several functions for converting numbers of all formats (integers, longs, floats, and so on) to strings and vice versa The following functions can be used to convert integers to strings : [Read more…] about How can I convert a Number to a String

How will you define String Processing along with the different String Operations

By Dinesh Thakur

String Processing (Storing Strings and String Operations) : In C, a string is stored as a null-terminated char array. This means that after the last truly usable char there is a null, hex 00, which is represented in C by ‘\0’. The subscripts used for the array start with zero (0). The following line declares a char array called str. [Read more…] about How will you define String Processing along with the different String Operations

« 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