Monthly Archives: November 2010

String handling functions in C

Like numbered arrays, C handles character arrays (strings). Each string is identified as a character array and ends with a ‘’(null) character (the compiler automatically adds the null character). So the end of string is identified as a null character. … Continue reading

Posted in C | Leave a comment

Passing entire structure to a function

A function can accept a structure as a parameter and even it returns a parameter too. Either the individual structure elements can be passed or the entire structure can be passed. Here is the example, for passing the entire structure … Continue reading

Posted in C | Leave a comment

Structures in C Programming

Structure in C groups different data type under a common name struct is a keyword to declare a structure The size of the structure depends on the size of the different data types Structure declaration always ends with a semicolon … Continue reading

Posted in C | Leave a comment

Workshop on MEMS at VIT University–Chennai Campus

 

Posted in Workshop | 1 Comment

C Program–Multiplying two matrices

/* Program to multiply two matrices */ #include <stdio.h> #include <conio.h> int main() {     int a[2][3],b[3][2],c[2][2],k,j,i;     printf("enter a");     for(i=0;i<2;i++)   //Get array A     {     for(j=0;j<3;j++)     {     scanf("%d",&a[i][j]);      }     }     printf("enter b"); … Continue reading

Posted in C | Leave a comment

C Program–Adding two matrices

/* Program to add two matrices */ #include <stdio.h> #include <conio.h> int main() {     int a[10][10], b[10][10],c[10][10],i,j;     printf("Enter a");     for(i=0;i<2;i++)  //get the matrix A         for(j=0;j<2;j++)     scanf("%d",&a[i][j]);     printf("Enter b");     for(i=0;i<2;i++) //get the matrix B … Continue reading

Posted in C | Leave a comment

How to interpret the NS2 tracefile (manually) for wireless simulation

Assume you created a tcl file for a wireless simulation and it generates a trace file (usually .tr as extension). If any tracing softwares are not available, how to interpret manually, here is the step ACTION: [s|r|D]: s — sent, … Continue reading

Posted in Network Simulator 2 | Leave a comment

C Program–To search a number in a given array

//This program is to search a given number in an array #include <stdio.h> #include <conio.h> int main() {     int a[10],i,num;     printf("enter the array elements");     for(i=0;i<10;i++) //get all the numbers     scanf("%d",&a[i]);     printf("Enter the number to search"); … Continue reading

Posted in C | Leave a comment

C Program–To sort a Given set of numbers in ascending order (Bubble Sort)

/* Program to sort the given set of numbers in ascending order, this sorting is called as bubble sort algorithm */ #include <stdio.h> #include <conio.h> int main() {     int a[10],i,j,temp=0;     printf("Enter all the 10 numbers");     for(i=0;i<10;i++)     … Continue reading

Posted in C | 1 Comment