C Tutorials

types of pointers in c 0

Different Types of Pointers in C

Pointers in C are a fundamental concept that allows you to work directly with memory addresses. They serve as a powerful tool, enabling you to manipulate data and structures efficiently. However, improper use of...

return by value in function in c 0

Return by Value in Function in C

Functions are fundamental building blocks in C programming that enable code modularity and reuse. A key aspect of functions is their ability to return values to the caller. There are different methods for functions...

Scope of Variables in C 0

Variable Scope in C – Local vs Global

Variables play a pivotal role in any programming language. They allow developers to store data during program execution for later use. However, not all variables behave the same – their accessibility within a program...

two dimensional arrays in c 0

Two Dimensional Array in C Programming

Arrays in C Arrays are one of the most useful data structures in C programming. They allow storing and accessing multiple values of the same data type through a single identifier. For example, an...

nested for loop in c 0

Nested For Loop in C with Examples

Loops allow us to repeatedly execute code in an efficient manner. They form an integral part of programming across languages. In C, we have tools like the humble for loop to perform repetitive tasks....

C Program For malloc() and calloc() Function 0

C Program For malloc() and calloc() Function

Program 1 //Diffrence between malloc and calloc function for Dynamic memory #include<stdio.h> #include<stdlib.h> #include<conio.h> void main() { int *ar,n,i; printf(“%d”,sizeof(int)); printf(“Enter the limit”); scanf(“%d”,&n); ar= (int*)calloc(sizeof(int),n); // n block of 4 size printf(“Enter elements...

C Program to Convert Binary to Octal 0

C Program to Convert Binary to Octal

Program 1 // Program for Binary to decimal and decimal to octal #include<stdio.h> #include<conio.h> #define clrscr() system(“cls”) int main() { int n,dn=0,r,b=1,binary,i=0,ar[50]; clrscr(); printf(“Enter a binary number( only 0 and 1 format)”); scanf(“%d”,&n); binary=n;...

C Program to Convert Binary to Hexadecimal 0

C Program to Convert Binary to Hexadecimal

Program 1 // Program for Binary to hexa decimal #include<stdio.h> #include<conio.h> #define clrscr() system(“cls”) int main() { int n,dn=0,r,b=1,binary,i=0,ar[50]; clrscr(); printf(“Enter a binary number( only 0 and 1 format)”); scanf(“%d”,&n); binary=n; while(n!=0) { r=n%10;...