Friday, May 24, 2013

program to implement else if command



Aim: Write a program to implement else if command.
Program:

#include<stdio.h>
int main(int argc, char *argv[])
{
          int fd;
          char c;
          if(arg!=2)
          {
                   printf(“ERROR”);
                    fd=open(argv[1],O_RDONLY);
                   while((sk=READ(fd,&c,1))==1)
          }
          printf(“%c”,&c);
          sk=lseek(fd,1000,0)
          printf(“New seek value = %d”,sk);
}
}
Output:
cc seek.c
./a.out seek.c
#new seek value 1000

No comments:

Post a Comment