Friday, 31 October 2014

Write a program to find length of a string using library function.

#include<stdio.h>
#include<string.h>
main()
{
    char str[100];
    printf("\nEnter a string=");
    scanf("%s",str);
    printf("\nLength of the string=%d",strlen(str));
}

Write a program to reverse a string using library function.

#include<stdio.h>
#include<string.h>
main()
{
    char str[100];
    printf("\nEnter a string=");
    scanf("%s",str);
    printf("\nAfter reversing the resultant string=%s",strrev(str));
}

Write a program to concanate two strings using library function.

#include<stdio.h>
#include<string.h>
main()
{
    char str1[100],str2[100];
    printf("\nEnter first string=");
    scanf("%s",str1);
    printf("\nEnter second string=");
    scanf("%s",str2);
    strcat(str1,str2);
    printf("\nAfter concatanation the resultant string=%s",str1);
}

Wednesday, 29 October 2014

CAO

    Addressing modes:    The Different ways in which the location of an operand is specified in an instruction are referred to as addressing modes.

    Register mode:    The operand is the content of a processor register; the name (address) of the register is given in the instruction.

Programming and Data Structures

Any AVL tree with n nodes has height less than 1.44logn.

Monday, 20 October 2014

Write a shall program to add two integers.

clear
echo -n "Enter two integers="
read a
read b
c=`expr $a + $b`
echo -n "The sum is $c"