Skip to main content

Posts

Showing posts with the label Programming

Quiz 1 : Mobile Application Development - Android

Download PDF Version From Here   MCQ 1. Select a component which is NOT part of Android architecture. a. Android framework   b. Libraries          c. Linux kernel   d. Android document 2. What is AAPT? a. Android Asset Processing Tool.             b. Android Asset Providing Tool.   c. Android Asset Packaging Tool.             d. Android Asset Packaging Technique 3. Required folder when Android project is created. a. build                 b. build/               c. bin     d. bin/ 4. Adb stands for   A. Android Drive Bridge.                  ...

Plenty of Programs of JSP & Servlet

Hey Guys Check Out The Following Link of Plenty of Programs of JSP & Servlet. Download & Enjoy The Stuff. Follow The Given Link Below  Download JSP & Servlet Program Bunch Here

Write a c program using system calls to display content of file.

/* Write a c program using system calls to display content of file. Kindly add header files like :stdio.h,sys/types.h,   sys/stat.h, unistd.h,string.h,fcntl.h  */ int main(int argc, char *argv[]) {         int fd=0,r=0,i=0;         char buf[1024];         if(argc >= 2)         {         for(i=1;i         {                 fd=open(argv[i],O_RDONLY);                 if(fd == -1)                 {                         printf("file not exist");                 }   else                 {                 while((r=read(fd,buf,1024))...

Write A C Program To Create A File And Write Something in it using System Calls.

/*Write A C Program To Create A File And Write Something in it using System Calls.*/ #include #include #include #include #include #include int main(int argc ,char *argv[]) {         int i=0,fd;         for(i=1;i         {                 fd=creat(argv[i],S_IREAD|S_IWRITE);                 write(fd,"file created",12);                 write(1,"file created\n",13);                 close(fd);         }         return 0; } See Also: Write any C program using write() system call. Write shell script that do equivalent to cut–c 5-10 utility Write C program that display name of all empty file and remove from directory.

Write shell script that do equivalent to cut–c 5-10 utility

#Write shell script that do equivalent to cut–c 5-10 utility. echo "Script Name : $0" i=0 lines=`cat $1 | wc -l` echo "No of lines in file named $1 : $lines" while [ $i -ne $lines ] do line=`head -$i $1 | tail -1` #echo $line #cutline= `echo expr substr "$line" 5 10` cutline=`echo $line | tail -c +5 | head -c 5` echo $cutline i=`expr $i + 1` #echo $i done echo "Done" See Also : Write C program that display name of all empty file and remove from directory.

Write C program that display name of all empty file and remove from directory.

/* Write C program that display name of all empty file and remove from directory   */ #include #include #include int main() { DIR *dp=opendir("."); struct dirent *files; struct stat stbuf; int siz=0,cnt=0; while((files=readdir(dp))!=NULL) { if(lstat(files->d_name,&stbuf)==-1) { printf("cant link"); } else { if(S_ISREG(stbuf.st_mode)) { siz=(int)stbuf.st_size; if(siz==0) { printf(" %s is empty file of size= %d \n",files->d_name,siz); //remove(files->d_name); unlink(files->d_name); cnt++; } } } } printf("\n number of empty file %d",cnt); return 0; }