Programming Tools

where students meet to knowledge

Category

C

C is a general-purpose, procedural, imperative computer programming language developed in 1972 by Dennis M. Ritchie at the Bell Telephone Laboratories to develop the UNIX operating system. C is the most widely used computer language. It keeps fluctuating at number one scale of popularity along with Java programming language, which is also equally popular and most widely used among modern software programmers.

Audience

This tutorial is designed for software programmers with a need to understand the C programming language starting from scratch. This tutorial will give you enough understanding on C programming language from where you can take yourself to higher level of expertise.

Prerequisites

Before proceeding with this tutorial, you should have a basic understanding of Computer Programming terminologies. A basic understanding of any of the programming languages will help you in understanding the C programming concepts and move fast on the learning track.

C Programming History

C is a general-purpose, procedural, imperative computer programming language developed in 1972 by Dennis M. Ritchie at the Bell Telephone Laboratories to develop the UNIX operating system. C is the most widely used computer language. It keeps fluctuating at number… Continue Reading →

C Programming Strings

In C programming, array of characters is called a string. A string is terminated by a null character /0. For example: “c string tutorial” Here, “c string tutorial” is a string. When, compiler encounter strings, it appends a null character /0 at the… Continue Reading →

How to pass arrays to a function in C Programming?

Passing One-dimensional Array In Function Single element of an array can be passed in similar manner as passing variable to a function. #include <stdio.h> void display(int age) { printf(“%d”, age); } int main() { int ageArray[] = { 2, 3,… Continue Reading →

C Programming Multidimensional Arrays

In C programming, you can create an array of arrays known as multidimensional array. For example, float x[3][4]; Here, x is a two-dimensional (2d) array. The array can hold 12 elements. You can think the array as table with 3 row and each… Continue Reading →

C Program to Calculate Standard Deviation

#include <stdio.h> #include <math.h> float calculateSD(float data[]); int main() { int i; float data[10]; printf(“Enter 10 elements: “); for(i=0; i < 10; ++i) scanf(“%f”, &data[i]); printf(“\nStandard Deviation = %.6f”, calculateSD(data)); return 0; } float calculateSD(float data[]) { float sum =… Continue Reading →

C Program to Find Largest Element of an Array

#include <stdio.h> int main() { int i, n; float arr[100]; printf(“Enter total number of elements(1 to 100): “); scanf(“%d”, &n); printf(“\n”); // Stores number entered by the user for(i = 0; i < n; ++i) { printf(“Enter Number %d: “,… Continue Reading →

C Program to Calculate Average Using Arrays

#include <stdio.h> int main() { int n, i; float num[100], sum = 0.0, average; printf(“Enter the numbers of elements: “); scanf(“%d”, &n); while (n > 100 || n <= 0) { printf(“Error! number should in range of (1 to 100).\n”);… Continue Reading →

C Programming Arrays

An array is a collection of data that holds fixed number of values of same type. For example: if you want to store marks of 100 students, you can create an array for it. float marks[100]; The size and type… Continue Reading →

Fibonacci series

#include<stdio.h> #include<math.h> void main() { int n,a,b; printf(“\nEnter the End term : “); scanf(“%d”,&n); printf(“\nFibonacci series : [ “); a=0; b=1; while(a<=n); { printf(“%d”,a); a=a+b; b=a-b; } printf(“]\n”); }

Check Number is Octal and Hexadecimal

#include<stdio.h> #include<math.h> void main() { int n; printf(“\nEnter a Number : “); scanf(“%d”,&n); printf(“\nOct Eqr : %o”,n); printf(“\nHex Eqr : %x”,n); }

Prime number progarm in C

#include<stdio.h> main() { int c,p=0,a,n; printf(“Enter the no. : “); scanf(“%d”,&n); for(c=2;c<a;c++) { if(a%c==0) { p=1; } } if(p==1) { printf(“No. is not prime”); } else printf(“No is prime”); }

Reverse of a number in C

REVERSE OF A NUMBER #include<stdio.h> main() { int n,q,r,x; printf(“Enter the number : “); scanf(“%d”,&n); q=n; x=0; while(q) { r=q%10; x=x*10+r; q=q/10; } printf(“Reverse of %d is %d\n\n”,n,x); }

© 2017 Programming Tools — acadinetech.com