Skip to content

Instantly share code, notes, and snippets.

View snadahalli's full-sized avatar

Sandeepa Nadahalli snadahalli

View GitHub Profile
@snadahalli
snadahalli / stddev.c
Created December 3, 2013 05:33
Function to calculate standard deviation.
float computeStandardDeviation(float a[], int n, float mean) {
float variance, deviation, sumsquare = 0;
int i;
for(i=0; i<n; i++) {
deviation = a[i] - mean;
sumsquare += deviation * deviation;
}
variance = sunsquare/(float)n;
@snadahalli
snadahalli / sumofrange.c
Created November 8, 2013 14:09
C Program to find the number and sum of all integers from 100 to 200 which is divisible by 7.
/***********************************************************
* You can use all the programs on www.c-program-example.com
* for personal and learning purposes. For permissions to use the
* programs for commercial purposes,
* contact info@c-program-example.com
* To find more C programs, do visit www.c-program-example.com
* and browse!
*
* Happy Coding
***********************************************************/
@snadahalli
snadahalli / evenoddsum.c
Created November 6, 2013 17:40
C Program to read ten integers from the keyboards and print the sum of even and odd numbers.
/***********************************************************
* You can use all the programs on www.c-program-example.com
* for personal and learning purposes. For permissions to use the
* programs for commercial purposes,
* contact info@c-program-example.com
* To find more C programs, do visit www.c-program-example.com
* and browse!
*
* Happy Coding
***********************************************************/
@snadahalli
snadahalli / squares.c
Created November 4, 2013 05:00
C Program to find the squares and cubes of a two digit odd number.
/***********************************************************
* You can use all the programs on www.c-program-example.com
* for personal and learning purposes. For permissions to use the
* programs for commercial purposes,
* contact info@c-program-example.com
* To find more C programs, do visit www.c-program-example.com
* and browse!
*
* Happy Coding
***********************************************************/
@snadahalli
snadahalli / quadratic.c
Created November 2, 2013 13:53
C program to find roots of a quadratic equation.
/***********************************************************
* You can use all the programs on www.c-program-example.com
* for personal and learning purposes. For permissions to use the
* programs for commercial purposes,
* contact info@c-program-example.com
* To find more C programs, do visit www.c-program-example.com
* and browse!
*
* Happy Coding
***********************************************************/
@snadahalli
snadahalli / quadrant.c
Created October 31, 2013 06:24
C Program to accept two integers for a co-ordinate point and determine its Quadrant.
/***********************************************************
* You can use all the programs on www.c-program-example.com
* for personal and learning purposes. For permissions to use the
* programs for commercial purposes,
* contact info@c-program-example.com
* To find more C programs, do visit www.c-program-example.com
* and browse!
*
* Happy Coding
***********************************************************/
@snadahalli
snadahalli / primeornot.c
Created October 29, 2013 06:58
C program to check whether a given number is prime or not.
/***********************************************************
* You can use all the programs on www.c-program-example.com
* for personal and learning purposes. For permissions to use the
* programs for commercial purposes,
* contact info@c-program-example.com
* To find more C programs, do visit www.c-program-example.com
* and browse!
*
* Happy Coding
***********************************************************/
@snadahalli
snadahalli / leapyear.c
Created October 24, 2013 11:11
C program to check whether a given year is leap year or not.
/***********************************************************
* You can use all the programs on www.c-program-example.com
* for personal and learning purposes. For permissions to use the
* programs for commercial purposes,
* contact info@c-program-example.com
* To find more C programs, do visit www.c-program-example.com
* and browse!
*
* Happy Coding
***********************************************************/
@snadahalli
snadahalli / fibonacci.c
Created October 24, 2013 03:58
C program to generate first n Fibonacci numbers.
/***********************************************************
* You can use all the programs on www.c-program-example.com
* for personal and learning purposes. For permissions to use the
* programs for commercial purposes,
* contact info@c-program-example.com
* To find more C programs, do visit www.c-program-example.com
* and browse!
*
* Happy Coding
***********************************************************/
@snadahalli
snadahalli / binary_search.c
Created October 21, 2013 03:26
Binary search on integer arrays.
/***********************************************************
* You can use all the programs on www.c-program-example.com
* for personal and learning purposes. For permissions to use the
* programs for commercial purposes,
* contact info@c-program-example.com
* To find more C programs, do visit www.c-program-example.com
* and browse!
* This program was originally published at
* http://www.c-program-example.com/2011/09/c-program-for-binary-search.html
* Happy Coding