History of C language

In 1965, Bell Telephone Laboratories, General Electric Company and Massachusetts Institute of Technology where working together to develop a new operating system called MULTICS. In 1969, Bell Laboratories ended its participation in the project. However, the participating members of Bell Labs, mainly Ken Thompson and Dennis Ritchie, still had an intention to create such kind … Read more

Why learn C?

One may argue that if there is plethora of programming languages available, then what makes C language so special? There are two answers to this question. First, C language has been used by programmers for past 30-40 years to develop every kind of utility. This means the language is well understood, the issues with the … Read more

Introduction to C Programming Language

In order to communicate any idea, thought, instruction or information, humans make use of spoken language. The fact is that you have just understood the very first sentence of this chapter all due to that. However, spoken languages are not understood by machines. Not only machines but also other living creatures of this planet do … Read more

Why is the C language important?

The following list illustrates the importance the C programming language, in no particular order: The C language is small and relatively easy to learn. C compilers can produce highly efficient code. C compilers and cross-compilers are widely available for a large array of hardware targets, from tiny eight-bit microcontrollers to giant mainframes. The availability of … Read more

Type Casting in c

C Programming Tutorial

Type Casting in c Type casting means changing a variable of one data type into another. The compiler will automatically change one type of data into another if it makes sense. For instance, if you assign an integer value to a floating-point variable, the compiler will convert the int to a float. Casting allows you to … Read more

Difference between Type Casting and Type Conversion

C Programming Tutorial

Difference between Type Casting and Type Conversion 1. Type Casting: In typing casting, a data type is converted into another data type by the programmer using the casting operator during the program design. In typing casting, the destination data type may be smaller than the source data type when converting the data type to another … Read more

C Program to find GCD of N Numbers

C program for GCD

C Program to find GCD of N Numbers #include<stdio.h> int main() { printf(“\n\n\t\tC Program for Greatest Common Divisor(GCD)\n\n\n”); int x, y =- 1; printf(“Enter numbers. To exit enter 0\n”); while(1) // infinite loop to take input { scanf(“%d”, &x); if(x < 1) break; else if(y ==- 1) // only 1 number entered, its GCD is … Read more

C program to Change the Text Background Color

C program to Change the Text Background Color

C program to Change the Text Background Color Few important points regarding this program are: SetConsoleTextAttribute: Sets the attributes of characters written to the console screen buffer by the WriteFile or WriteConsole function, or echoed by the ReadFile or ReadConsole function. This function affects text written after the function call. Syntax: BOOL WINAPI SetConsoleTextAttribute(_In_ HANDLE hConsoleOutput , _In_ WORD wAttributes); Below is the … Read more

C Program to create a Menu Driven software using Switch Case

switch case flow chart

C Program to create a Menu Driven software using Switch Case #include<stdio.h> int main() { printf(“\n\n\t\tMenu driven program in c\n\n\n”); int choice, num, i; unsigned long int fact; while(1) { printf(“1. Factorial \n”); printf(“2. Prime\n”); printf(“3. Odd\\Even\n”); printf(“4. Exit\n\n\n”); printf(“Enter your choice : “); scanf(“%d”,&choice); switch(choice) { case 1: printf(“Enter number:\n”); scanf(“%d”, &num); fact = … Read more