Skip to main content

Posts

Showing posts from February 10, 2012

Important programs of C Language

/* Display The current Time in c language*/ #include<stdio.h> #include<conio.h> #include<dos.h> void main() {    struct date d;   getdate(&d);   printf("Current system date is %d/%d/%d",d.da_day,d.da_mon,d.da_year); getch(); } /*This program list all files present in a directory/folder in which this executable file is present. For example if this executable file is present in C:\\TC\\BIN then it will lists all the files present in C:\\TC\\BIN.*/ #include<stdio.h> #include<conio.h> #include<dir.h> void main() { int done; struct ffblk a; printf("Press any key to view the files in the current directory\n"); getch(); done = findfirst("*.*",&a,0); while(!done) {   printf("%s\n",a.ff_name);   done = findnext(&a);  } getch(); } /* Open the notepad using c program/* #include<stdlib.h> void main() { system("C:\\Windows\\System32\\notepad.exe"); } Note : When run

C & C++ language code for password

C language code for password: #include<iostream.h> #include<conio.h> #define MAX 500 void main() {     char password[MAX];     char p;     int i=0;     printf("Enter the password:");       while((p=getch())!= 13)  {          password[i++] = p;          printf("*");     }     password[i] = '\0';     if(i<6)          printf("\nWeak password");     printf("\nYou have entered: %s",password);     getch(); } C++ language code for password: #include<iostream.h> #include<conio.h> #define MAX 500 void main() {     char password[MAX];     char p;     int i=0;    clrscr();    cout<<"Enter the password:";       while((p=getch())!= 13){          password[i++] = p;          cout<<"*";     }     password[i] = '\0';     if(i<6)          cout<<"\nWeak password\n";     cout<<"You have ent

INFOSYS INTERVIEW

Most of the questions are raised from your resume, so always have enough knowledge about each thing that you mention. I hope it can help.  “Good afternoon sir” v Good-afternoon, please have a seat.  “Thank you” v Fill up this sheet.  A sheet with columns for my rollno, name and signature was filled.  Give me your resume.  I opened the portfolio, took out the resume and handed over gently  So your father works in BHEL?  “No sir, my mother is a school teacher there and thus we are living in the quarter allotted to us. My father is a businessman”  What kind of business?  “He deals with plastic bottles and their marketing”  Only marketing? No manufacturing?  “Manufacturing as well, but not on that level”  Interviewer analyzes the resume  What is this KPS?  “It is Kalka Public School in New Delhi, I lived there in a hostel during my +1 and +2.”  So what difference did you find in the hostel life?  “I learned a lot of things in the hostel, being independen