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
 
 
struct marks                                                     
   {
       int  sub1;                                                   
       int  sub2;                                                   
       int  sub3;                                                   
       int  total;                                                  
   };                                                               
   main()                                                           
   {
       int  i;                                                      
       struct marks student[3] =  {{45,67,81,0},             
                                   {75,53,69,0},             
                                   {57,36,71,0}};            
       struct marks total;                                   
       for(i = 0; i <= 2; i++)                                      
       {                                                            
           student[i].total = student[i].sub1 +                     
                              student[i].sub2 +                     
                              student[i].sub3;                      
           total.sub1 = total.sub1 + student[i].sub1;               
           total.sub2 = total.sub2 + student[i].sub2;               
           total.sub3 = total.sub3 + student[i].sub3;               
           total.total = total.total + student[i].total;            
       }                                                            
       printf(\" STUDENT          TOTAL\\n\\n\");                       
       for(i = 0; i <= 2; i++)                                      
          printf(\"Student[%d]      %d\\n\", i+1,student[i].total); 
       printf(\"\\n SUBJECT          TOTAL\\n\\n\");                     
       printf(\"%s       %d\\n%s       %d\\n%s       %d\\n\",            
              \"Subject 1   \", total.sub1,                           
              \"Subject 2   \", total.sub2,                           
              \"Subject 3   \", total.sub3);                          

       printf(\"\\nGrand Total = %d\\n\", total.total);                 
   }                                                                

Output                                                           

        STUDENT           TOTAL                                          
        Student[1]         193                                           
        Student[2]         197                                           
        Student[3]         164                                           

        SUBJECT           TOTAL                                          
        Subject 1          177                                           
        Subject 2          156                                           
        Subject 3          221                                           

        Grand Total  = 554                                                

 
 
Didn't find what you were looking for? Find more on Illustration of subscripted structure variables , ARRAYS OF STRUCTURES