Category Archives: C Language

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

4 C Programs Find GCD and LCM

Topic: 4 C Programs Find GCD and LCM The Greatest Common Divisor – GCD The greatest common divisor (GCD) of two integers is the largest positive integer dividing both. In mathematics, the greatest common divisor (gcd) of two or more integers, is the largest positive integer that divides each of the integers. For example, the… Read More »

Loading