Functions in C

function in c

Functions C Human is an intelligent species, but still cannot perform all of life’s tasks all alone. He has to rely on others. You may call a mechanic to fix up your bike, hire a gardener to mow your lawn, or rely on a store to supply you groceries every month. A computer program (except … Read more

Linear search program in c

c program to sort array

Linear search program in c   #include <stdio.h> int main() { int array[100], search, c, n; printf(“Enter number of elements in array\n”); scanf(“%d”, &n); printf(“Enter %d integer(s)\n”, n); for (c = 0; c < n; c++) scanf(“%d”, &array[c]); printf(“Enter a number to search\n”); scanf(“%d”, &search); for (c = 0; c < n; c++) { if … Read more

C Program to Check Whether a Character is Vowel or Consonant

c program for vowel and consonent

C Program to Check Whether a Character is Vowel or Consonant The five alphabets A, E, I, O and U are called vowels. All other alphabets except these 5 vowel letters are called consonants.   #include <stdio.h> int main() { char c; int isLowercaseVowel, isUppercaseVowel; printf(“Enter an alphabet: “); scanf(“%c”,&c); // evaluates to 1 (true) … Read more

C Program to check whether a Number is a Palindrome

palindrome program in c

C Program to check whether a Number is a Palindrome A palindrome is a number or a string which is similar when read from the front and from the rear. For example: 121 or Oppo etc. Below is a program to check whether a number is a palindrome or not. #include<stdio.h> #include<conio.h> void main() { int a, … Read more

Goto Keyword in c Program

c prgram avoid goto

Goto Keyword in c Program In a difficult programming situation it seems so easy to use a goto to take the control where you want. However, almost always, there is a more elegant way of writing the same program using if, for, while and switch. These constructs are far more logical and easy to understand. … Read more

pointer example program in C

pointer c program example

pointer example program in C What would be the output of following pointer program written in c   main( ) { int a = 10, b = 20 ; swapr ( &a, &b ) ; printf ( “\na = %d b = %d”, a, b ) ; } swapr( int *x, int *y ) { … Read more

Introduction to Pointers in C

understanding c pointers

Introduction to Pointers in C Pointer Notation Consider the declaration, int i = 3 ; This declaration tells the C compiler to: Reserve space in memory to hold the integer value. Associate the name i with this memory location. Store the value 3 at this location. We may represent i’s location in memory by the … Read more

c program example function and pointer

c program example function and pointer

c program example function and pointer What would be the output of the following programs: main( ) { int i = 0 ; i++ ; if ( i <= 5 ) { printf ( “\nC adds wings to your thoughts” ) ; exit( ) ; main( ) ; } }

What wound be output of the following c program of function and pointer

c program example function pointer

What wound be output of the following c program of function and pointer What would be the output of the following programs:   main( ) { int i = 5, j = 2 ; junk ( &i, &j ) ; printf ( “\n%d %d”, i, j ) ; } junk ( int *i, int *j … Read more