Thursday, 25 July 2013

Dangling pointer problem in c programming:

1. Dangling pointer:
If any pointer is pointing the memory address of any variable but after some variable has deleted from that memory location whilepointer is still pointing such memory location. Such pointer is known as dangling pointer and this problem is known as dangling pointer problem.
Initially:
Later:

Monday, 22 July 2013

How to reverse a string in c without using reverse function

#include<stdio.h>
int main(){
    char str[50];
    char rev[50];
    int i=-1,j=0;

    printf("Enter any string : ");
    scanf("%s",str);
 
    while(str[++i]!='\0');

    while(i>=0)
     rev[j++] = str[--i];

    rev[j]='\0';
 
    printf("Reverse of string is : %s",rev);
 
    return 0;
}

Sample output:
Enter any string : ramprofessionals.blogspot.com
Reverse of string is : moc.topsgolb.slanoisseforpmar

Friday, 19 July 2013

INVENTORS OF COMPUTER HARDWARE:

(1) Key board — Herman Hollerith, first keypunch device in 1930’s

(2) Transistor — John Bardeen, Walter Brattain & Wiliam Shockley (1947 - 1948)

(3) RAM — An Wang and Jay Forrester (1951)

(4) Trackball — Tom Cranston and Fred Longstaff (1952)

(5) Hard Disk — IBM , The IBM Model 350 Disk File (1956 )

(6) Integrated Circuit— Jack Kilby & Robert Noyce (1958)

(7) Computer Mouse — Douglas Engelbart (1964)

(8) Laser printer— Gary Stark weather at XEROX in 1969.

(9) Floppy Disk— Alan Shugart & IBM( 1970)

(10) Microprocessor — Faggin, Hoff & Mazor – Intel 4004

Solve this puzzle... ?

A shopkeeper has 3 bags of coconut each containing 30 coconuts. While travelling from one place to other, he has to pass 30 toll-booths. At every toll-booth, he has to give coconuts equal to number of bags he have. After passing all 30 toll-booths, how many coconuts will be left with the shopkeeper?

Reply fast...

Monday, 8 July 2013