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

Python GCD Recursive Function

Python GCD Recursive Function – Write a Python Program to find GCD of two numbers by recursion. Python GCD Recursive Function Python Program GCD of Two Numbers # Write a Python Program to find GCD # of two numbers using Recursion # define a recursive GCD function def recursive_gcd(a,b): if(b==0): return a else: return recursive_gcd(b,a%b)… Read More »

Loading

Python Power Recursive Function

Python Power Recursive Function – Write a Python program that uses recursion concept to calculate a number N raised to the power P.   Python Recursive Function Power # Write a Recursive Function power_recursive(n,p) # to calculate n raised to power p. # define function def power(n, p): if p == 0: return 1 else:… Read More »

Loading

Python Recursive Function Add Numbers

Python Recursive Function Add Numbers – Write a Python Program to display sum of 1 to 10 numbers using recursion. Call this recursive function in main. Python Code – Program With Recursive Function Add Numbers # Write a recursive function to add numbers # from 1 to 10 recursively. Call it from # main function… 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