Startertutorials Blog
Tutorials and articles related to programming, computer science, technology and others.
Subscribe to Startertutorials.com's YouTube channel for different tutorial and lecture videos.

C program to reverse an array in place using pointers

Categories: Pointers. No Comments on C program to reverse an array in place using pointers

In this article we will learn to implement a C program to reverse an array in place using pointers. A C program is provided below to reverse the given array in place using pointers. Program is as follows: #include<stdio.h> void reversearray(int *p, int n) { int *first = p; int *last = p+n-1; while(first<last) { […]

Read the rest of this entry »

C program to reverse an array in place

Categories: Arrays. No Comments on C program to reverse an array in place

In this article we will learn to implement a C program to reverse an array in place (without using a temporary array. A C program is provided below to reverse an array in place. Program is as follows: #include<stdio.h> int main() { int array[20]; int n; printf("Enter number of elements: "); scanf("%d", &n); printf("Enter array […]

Read the rest of this entry »

C program to print prime numbers using Sieve of Eratosthenes

Categories: Others. 1 Comment on C program to print prime numbers using Sieve of Eratosthenes

This is a C program to print prime numbers using Sieve of Eratosthenes, which is said to be the most efficient algorithm for generating prime numbers.   The program is as follows: #include<stdio.h> int main() { int n; printf("Enter n value: "); scanf("%d", &n); int prime[n+1]; //Loading the array with numbers from 1 to n […]

Read the rest of this entry »

C program to demonstrate how to use a typedef struct in c

Categories: Structures and Unions. No Comments on C program to demonstrate how to use a typedef struct in c

In this article we will learn to implement a C program to demonstrate how to use a typedef struct in c. A C program is provided below which illustrates how to use typedef along with a structure.   Program is as follows: /* * C program to demonstrate typedef usage with a structure * Author: […]

Read the rest of this entry »

C program to demonstrate accessing a structure using a pointer

Categories: Structures and Unions. No Comments on C program to demonstrate accessing a structure using a pointer

In this article we will learn to implement a C program to demonstrate accessing a structure using a pointer. A C program is provided below that illustrates how to access a structure using a pointer.   Program is as follows: /* * C program to demonstrate accessing a structure using a pointer * Author: P.S.SuryaTeja […]

Read the rest of this entry »

C program to demonstrate union

Categories: Structures and Unions. No Comments on C program to demonstrate union

In this article we will learn to implement a C program to demonstrate union. A C program is provided below to illustrate the concept of unions in C language.   Program is as follows: /* * C program to demonstrate union * Author: P.S.SuryaTeja */ #include <stdio.h> #include <conio.h> #include <math.h> #include <stdlib.h> union student […]

Read the rest of this entry »

C program to demonstrate structure

Categories: Structures and Unions. No Comments on C program to demonstrate structure

In this article we will learn to implement a C program to demonstrate structure. A C program is provided below for demonstrating a structure.   Program is as follows: /* * C program to demonstrate structure * Author: P.S.SuryaTeja */ #include <stdio.h> #include <conio.h> #include <math.h> #include <stdlib.h> struct student { int id; char name[20]; […]

Read the rest of this entry »