C Programming Tutorial

 
 
 

Advanced Programming

Array

One dimensional array Two dimensional Array Two dimensional array pointers Array of pointers Print array Print Array - for loop Print array in reverse Print address array - for loop Multidimentional array - function Print address array - pointers Print reverse string of array Print array ascii value-without atoi Character array - upper case Multiplication table - 2D array Passing array to function Max or greatest value in array Merge sorted array Array of structure Array of pointers to string Array within a structure

String Programs

Copy string Substring of string String concatination Vowel in string Swap char in string Palindrome string Rotate string Bubble sort of strings Sorting of words Encode decode string Compress string

File Programs

Read write in 2 files Add,edit,delete,search in file Add,search using structure Append in file Merge file Count word,line,char in file Count record - struct fread() example fwrite() example fopen() example fclose() example fscanf() and fprintf() fseek() example Error handling in file op Find odd,even num Odd even numbers in file Max, min age in class Random numbers file Preprocessor in 2 files Encode decode in file

Bios Programming

biosequip( ) - sys confi biosdisk( ) - partition tbl info Pc type-bios data area File allocation table Telephone directory

TSR Programming

Interchange letters Interchange letters on screen Unload TSR on key press-keyboard Unload TSR - timer interrupt Activate, deactivate TSR Print alphabet from printer Repeat key press Keep caps on Make ctrl, alt key pressed

Interrupt Programming

Restart computer Conventional memory of sys Save IVT in file Print string-interrupt 21h Read char-interrupt 21h Read char with echo-interrupt 21h Delete file-interrupt 21h Delete directory-interrupt 21h Get set system date Show system configuration Search, delete file in dir Display multiple file in dir

Mouse Programming

Text mode mouse handling Graphics mode mouse handling Double click of mouse
 
 
#include <stdio.h>
#include <conio.h>


void main(int argc,char *argv[]){
     FILE *fmrg,*fd1,*fd2;
     int data1[]={1,3,9,15,18,20,30};
     int data2[]={2,3,5,8,9,23,28};
     int i,data,tmp1,tmp2;

     clrscr();
     fd1 = fopen(\"data1.txt\",\"w\");
     for(i=0;i<7;i++)
    putw(data1[i],fd1);
     fclose(fd1);

     fd2 = fopen(\"data2.txt\",\"w\");
     for(i=0;i<7;i++)
    putw(data2[i],fd2);
     fclose(fd2);

     fmrg = fopen(argv[1],\"w\");
     fd1  = fopen(\"data1.txt\",\"r\");
     fd2  = fopen(\"data2.txt\",\"r\");
     //merge logic
     while(!feof(fd1)){
    data = getw(fd1);
    putw(data,fmrg);
     }
     while(!feof(fd2)){
    data = getw(fd2);
    putw(data,fmrg);
     }
     fclose(fd1);
     fclose(fd2);
     fclose(fmrg);

     printf(\"\\n\\n***After Merging Files***\\n\\n\");
     fmrg = fopen(argv[1],\"r\");
     while(!feof(fmrg))
     {
    data = getw(fmrg);
    printf(\"%5d\",data);
     }
     fclose(fmrg);

     /*
     //sort logic
     fd1 = fopen(argv[1],\"r\");
     fd2 = fopen(argv[1],\"r\");
     while(!feof(fd1)){
      fseek(fd1,2L,SEEK_CUR);
      tmp1 = getw(fd1);
      while(!feof(fd2)){
         fseek(fd2,2L,SEEK_CUR);
         tmp2 = getw(fd2);
         if(tmp1 > tmp2)
     */
getch();
}

    Related Post:
  1. Program to convert expression in postfix form to prefix form

  2. Program to generate random numbers

  3. PROGRAM THAT CHECK WHETHER THE GIVEN NUMBER IS PRIME IN PARALLEL

  4. Program to print number triangle in reverse pattern

  5. Program to read the following numbers,round them off to the nearest integers and print out the results in integer form: 35.7 50.21 -23.73 -46.45

  6. PROGRAM TO CALCULATE STANDARD DEVIATION

  7. Program to find the maximum and minimum element in an array using threads

  8. Example of preprocessor - 5

  9. Program to find mode of the given array

  10. Program to find out the sum of odd and even numbers between given range

  11. Program that will accept a line of text from the text file; count the number of words, lines, and characters in the file

  12. Preparation of the rank list of a class of students using pointers and two dimensional arrays

  13. Program to calculate roots of 3 numbers using root1 = (-b + sqrt(discriminant))/(2.0*a) and root2 = (-b - sqrt(discriminant))/(2.0*a) formula

  14. Program to calculate average of the elements of an array and then the average deviation using barrier

  15. Singly Linked list with following operations INSERT AT STARTING, INSERT AT MIDDLE, INSERT AT END, DELETE FIRST NODE, DELETE LAST NODE, DELETE MIDDLE

  16. Program to find files with duplicate names using binary search tree

  17. Program to convert value from one currency to another i.e. from dollar to rupees and rupees to dollar

  18. FUNCTION TABULATED AT EQUAL INTERVAL USING FORWARD DIFFERENCE BETWEEN TABLE VALUE

  19. ACCESSING VARIABLES USING POINTERS

  20. Program to solve the backward dependancy for the following equation using Fair way - x[i]=x[i-1]+y[i]

 
 
Didn't find what you were looking for? Find more on Program to merge and display 2 files