Category Archives: Using Pointers in C Language

Using Pointers Sort Array

Using Pointers Sort Array – Write a program in C Programming Language To input N numbers and arrange it in Ascending Order. Using Pointers Sort Array – C Source Code #include <stdio.h> void main() { int *ptr,a[100],i,j,temp,n; printf(“\n\n Using C Pointers : Sort an array using pointer :\n”); printf(“—————————————————-\n”); printf(” Enter the size of array… Read More »

Loading

Using Call by Reference Swap Numbers

Using Call by Reference Swap Numbers – Write a C program to swap two values by call by reference method of parameter passing. Program for Passing Parameters – Call By Reference #include <stdio.h> void swap2numbers(int *n1, int *n2); int main() { int num1,num2; printf(“\n\n Using C Pointers : Swap Numbers Using Call by Reference :\n”);… Read More »

Loading

Using Pointers Count Vowels

Using Pointers Count Vowels – Write a program in C Programming Language to count the number of vowels and consonants in a string using a pointer. Source Code for Program   #include <stdio.h> int main() { char str1[100],ch; char *ptr; int vcount=0,ccount=0; printf(“\n\n Using C Pointers : Count Vowels and Consonants :\n”); printf(“—————————————————–\n”); printf(” Enter… Read More »

Loading

Using Pointers Find String Length

Using Pointers Find String Length – Write a C Program to Find the length of the string using a pointer. C Program to Find the length of the string using a pointer Source Code Calculate Length of a String – C Pointers #include <stdio.h> int main() { char string1[50]; char *ptr; int length=0; printf(“\n\n Using… Read More »

Loading

Average of Array With Pointer

Average of Array With Pointer – Write a C Program to calculate average of array elements using pointers. #include <stdio.h> int main() { int a[50], i,n, sum=0; float average; int *ptr; printf(“\n Write a C Program To:”); printf(“\n Input elements and Find Average in”); printf(“\n Array Using Pointers in C:”); printf(“\n ————————————\n”); printf(” Enter the… Read More »

Loading

Sum of Array Using Pointers

Sum of Array Using Pointers – Write a C program to input n numbers in one dimensional array and find sum of all elements with pointer arithmetic. You will love to read Understanding C Pointers Basic Concepts before reading this program. C Program Sum of Array Using Pointers #include <stdio.h> int main() { int a[50],… Read More »

Loading

Using Pointers With Array Input Output

Using Pointers With Array Input Output – Write a C program to input and output n elements in a one dimensional array.   Using Pointers With Array Input Output – C Program #include <stdio.h> int main() { int a[50], i,n; int *ptr; printf(“\n C Pointer Progrmming Examples:”); printf(“\n Input and output numbers in One Dimensional… Read More »

Loading

Understanding C Pointers

Understanding C Pointers – will give you a deep understanding of pointer concept in C programming language. What is a Pointer in C? A Pointer is a special variable that can hold the memory address of another variable. We will use the reference operator ( & ) to store memory address in a pointer variable.… Read More »

Loading

Using Pointers Add Numbers

Pointers in C Language: Program To Add Two Numbers Using Pointers   #include <stdio.h> int main() { int num1, num2, *ptr1, *ptr2, sum; printf(“\n\n Pointers in C : Program to Add two numbers :\n”); printf(“————————————————-\n”); printf(” Enter the first number : “); scanf(“%d”, &num1); printf(” Enter the second number : “); scanf(“%d”, &num2); ptr1 =… Read More »

Loading