Friday, 26 June 2015

C language basic programs 2

1. //program on fundamental data types
#include<stdio.h>
#include<conio.h>
int main()
{
int a;
float b;
char c;
double d;
a=5;
b=10.2;
c='M';
d=9.325;
printf("%d %f %c %lf",a,b,c,d);
getch();
return 0;
}


output: 5 10.200000 M 9.325000



2.    //to calculate area of rectangle
#include<stdio.h>
#include<conio.h>
int main()
{
int l, b, area, perimeter;
printf("enter values of length and breadth\n");
scanf("%d %d",&l, &b);
area=l*b;
perimeter=2*(l+b);
printf("area of rectangle is %d\n",area);
printf("perimeter of rectangle is %d",perimeter);
getch();
return 0;

}



output: enter values of length and breadth
2 4
area of rectangle is 8
perimeter of rectangle is 12




3.//to calculate area of rectangle
#include<stdio.h>
#include<conio.h>
int main()
{
float r, area, perimeter;
printf("enter the value of radius of circle\n");
scanf("%f",&r);
area=3.14*r*r;
perimeter=(2*3.14*r);
printf("area of circle is %f\n",area);
printf("perimeter of circle is %f\n",perimeter);
getch();
return 0;

}


output: enter the value of radius of circle
              5
area of circle is 78.500000
perimeter of circle is 31.400000




4.//to calculate area of triangle
#include<stdio.h>
#include<conio.h>
#include<math.h>
int main()
{
int a,b,c,p;
float s,area;
printf("enter the values of a,b,c\n");
scanf("%d%d%d",&a,&b,&c);
p=a+b+c;
s=(a+b+c)/(2.0);
area=sqrt(s*(s-a)*(s-b)*(s-c));
printf("area of triangle is %f\n",area);
printf("perimeter of triangle is %d\n",p);
getch();
return 0;

}


output: enter the values of a,b,c
            2 3 4
area of triangle is 2.904737
perimeter of triangle is 9





5.//sawaping of two numbers
#include<stdio.h>
#include<conio.h>
int main()
{
int a,b,temp;
printf("enter two numbers\n");
scanf("%d %d",&a,&b);
printf("before swaping the values of a and b are %d %d\n",a,b);
temp=a;
a=b;
b=temp;
printf("after swaping the values of a and b are %d %d\n",a,b);
getch();
return 0;

}

output: enter two numbers
              3 5
before swaping the values of a and b are 3 5
after swaping the values of a and b are 5 3



Thursday, 25 June 2015

C language basics 1

History:

 C language was developed at AT & T's Bell laboratories of USA in 1972. It is designed and written by Dennis Ritchie.

Features of C language:
1.Middle level language
2.Structural
3.Easy to understand
4.Portability i.e., programs written in one system can be copied into another system and can be executed easily
4.More efficient
5.Compile language
6.Windows, Linux and Unix are written in C because of its high performance

Compiler: basically the system understands only machine level language i.e., written in 1's and 0's.
Here compiler does the job of converting the source code to machine level language


Constant:
1. A constant is an entity that doesn't change
2.Alphabets, numbers and special symbols can be used to form constants.

                                                       constants    -  Integer constants -     5, 12, 28, 264, 768 etc

                                                                               Real constants    -      5.20, 6.25, 235.12, 5.21 etc

                                                                              Character constants- 'a', 'h', '9', '=' etc

Variable:
   A variable is an entity that does change.

Ex:        #include<stdio.h>
              #include<conio.h>
              int main()
 {
              int x=10;                  
              printf("the value of x is %d\n",x);
               x=x+1;
              printf("the value of x is %d\n",x);
 getch();
 return 0;
}

output: the value of x is 10
             the value of x is 20

Here x is a variable and 10, 20 are integer constants.

Variable types:
 1. Integer                                  - keyword is int         ex: int a, int x
 2.Real or floating point type    - keyword is float      ex: float area, float average, etc
 3.Character                               - keyword is char      ex: char a, char i, etc

Keywords:
     These are the words whose meaning has already been explained to the c compiler.
By using keywords we can construct the meaningfull statements.

           Ex: break, int, float, char, if, for.....etc
Note: keywords cannot be used as variable names.

Basic programs:

// to print hello

#include<stdio.h>
#include<conio.h>
int main()
{
printf("hello");
getch();
return 0;
}


Description:
#  - Pre processor directive:  it is a program that processes our source code before it is passed to the compiler

In the C Programming Language, the Standard Library Functions are divided into several header files.
The following is a list of functions found within the <stdio.h> header file:

FORMATTED INPUT/OUTPUT FUNCTIONS


fprintf                               Formatted File Write      
fscanf                               Formatted File Read
printf                                Formatted Write
scanf                         Formatted read
sprintf                        Formatted string write
sscanf                       Formatted string read
vfprintf                       Formatted File Write Using Variable Argument List
vprintf                        Formatted Write Using Variable Argument List
vsprintf                      Formatted String Write Using Variable Argument List  


CLOSE FILE
FLUSH FILE BUFFER
OPEN FILE
REOPEN FILE
REMOVE FILE
RENAME FILE
SET BUFFER (OBSOLETE)
SET BUFFER
CREATE TEMPORARY FILE
GENERATE TEMPORARY FILE NAME

CHARACTER INPUT/OUTPUT FUNCTIONS
Read Character from File
Read String from File
Write Character to File
Write String to File
Read Characters from File
Read Character
Read String
Write Character to File
Write Character
Write String
Unread Character



BLOCK INPUT/OUTPUT FUNCTIONS

                         Read Block from File
                         Write Block to File
FILE POSITIONING FUNCTIONS
 Get File Position
fseek                         
File Seek
Set File Position
Determine File Position
Rewind File













conio.h library functions


      All C inbuilt functions which are declared in conio.h header file are given below. 

List of inbuilt C functions in conio.h file:

S.noFunctionDescription
1clrscr()This function is used to clear the output screen.
2getch()It reads character from keyboard
3getche()It reads character from keyboard and echoes to o/p screen
4textcolor()This function is used to change the text color
5textbackground()This function is used to change text background
       

     
main()  
{
     /*main() is a function . A function is nothing but a set of statements.In a C program there can be multiple functions.All statements that belong to main() are enclosed within a pair of braces {} as shown here.*/




}



printf(" enter x value");    :  standard function used to print something on to the screen.
scanf("%d",&x);                :reads values or data from the user through input devices.
getch();                                 :It reads character from keyboard.


void main()   : does not expect any output value at the end of the program

int main()      :expects some integer value at the end of the program


//program to calculate simple interest


#include<stdio.h>

#include<conio.h>
int main()
{
int p,n;
float r,si;
p=1000;
n=3;
r=8.5;
//formula for simple interest 
si=(p*n*r)/100;
printf("%f\n",si);
return 0;
}

output: 255.000000





//To calculate simple interest for any values of p, n and r


#include<stdio.h>

#include<conio.h>
int main()
{
int p,n;
float r,si;
printf("enter values of p, n,r");
scanf("%d %d %f",&p,&n,&r);
si=(p*n*r)/100;
printf("%f",si);
return 0;
}


output: enter values of p, n,r 4 5 2

               0.400000








10 Executive Resume Do's and Don'ts

Guys before reading this, remember that we do not have any specific rules for writing a resume. You can unveil your creativity in writing your resume but, I hope these little things will help you out in writing a resume in a better way.

1. Streamline Your Resume Header

To avoid confusion and keep your resume header clean, include just one contact number – the one you’re most accessible and will frequently check the voicemail for – typically your mobile phone.
Get a new email address if you are currently using a unprofessional one. I’ve seen some downright offensive email addresses. Don’t turn people off before you give them the chance to consider you. And a silly, unprofessional email address may land your email message and resume in a spam filter. Set up a designated job hunting email account with an address using your first and last names.
2. Objective Statements Are So Yesterday
Don't use a time-worn objective statement at the top of your resume. Employers don’t care that you want a “growth position that will utilize your skills and experience in XYZ. They want to know what you’ll do for them. All of the content on your resume should be focused on your potential value to your target employers and the growth of the organisation.
3. Pack a Punch on the First Page
Brand your value "above the fold" and design the entire first page to stand on it’s own. Assume that readers will go no further than your first page, because that could easily be the case. Subsequent pages are there to provide supporting evidence, and include earlier relevant career highlights and education/professional development and achievements. An interest-grabbing first page will lead readers to move beyond it, to the following pages.
4. Tell the Truth!
Your resume must be 100% truthful. Stretching the truth or outright lies will catch up with you, and damage your credibility and their belief on you. Even a little white lie can result in your being suddenly out of the running, or subsequent immediate termination, if you’ve managed to squeak through and get hired.
5. Avoid Blah Resume-speak
Replace stale, overused phrases like “responsible for” with robust action verbs, like accelerated, pioneered, launched, advanced, optimized, etc.
Write your resume from your own voice. You’re not like everyone else try something different. Find the precise words that describe what makes you unique and valuable. Keep the content interesting and don’t fall back on dull phrases that don’t differentiate you, such as results-oriented, visionary leader, excellent communication skills, hard working, proven track record of success, etc.
6. Don't Include Irrelevant Information
These items should be left off your resume:
  • Personal information – marital status, health etc.
  • Hobbies – Which don't have any relation with the kind of profession you are entering into like watching movies, playing games on Facebook etc.
  • Personal references
  • Irrelevant certifications, awards, etc. i.e., do not include the certifications which do not add any value to you in getting placed in XYZ company.
7. Formatting Should Be Attractive and Easy To Read
Keep the formatting consistent and clean. Don’t use frilly fronts, or more than two different fonts, and don’t use underlining. This kind of formatting can be woozy to readers and turn them off.
Concise on-brand statements of value, surrounded by enough white space to make them pop, look best. If you’ve done your homework correctly, these statements will provide clear evidence of your success impacting bottom line, and position you as the best-fit candidate for the job. Use bullets or  points for better impact.
Break up long chunks of information into no more than about 3-4 lines (max of 5 lines).
8. Your Resume Must Be Flawless
Grammatical errors and inconsistencies, typing errors, and misspellings are unacceptable as you being entering into a professional job, and they reflect badly on you. Don’t rely entirely on Spell Check. Print out the document and review it several times. Ask others to check it as well.
9. What About Resume Length?
Try to make your resume 1-2 pages and a maximum of 3 pages. Include only relevant information that is required in fetching you a good job. Do not include all your activities and personal information in the resume, that information you can share with the interviewer.
10. Don’t Worry About Having Too Much Information
You’ll be gathering a lot of information for your resume. Initially, don’t worry that you won’t be able to fit it all into 2 or 3 pages. Nothing will go to waste. Excess information can be used for collateral supporting documents and/or interviews, and the entire personal branding and resume development process serves as a terrific confidence-builder and energizer to prep you for your executive job search. The hard work you’ll be doing will set you up to succeed.
Hi guys, I am creating this blog to add some posts and videos related to placements which helps you to get a chance to get placed in a reputed organisation for a better career.Hope you all enjoy going through this blog everyday and know the latest updates.
       It is almost the moment where the talk on placements is going thick in air. Be it a career plan or a back up option, each of us have that unquenched thirst for a job, the first job!! We all yearn for that job which pays a 6 digit salary with a leisurely framed work schedule and a cozy social life- the perfect definition of sinecure. Some are particular on jobs in the core, some on programming, while some Good Samaritans be like- I need a job, whatever it is into!!
                            This is the time where we take things on a serious note and start some groundwork to make it to our dream companies. Stick on to your schedule and work on those areas you feel you’re weak at. Grab a few editorials and give a quick read to improve your reading comprehension. Add a few fresh words to your vocabulary. Crack those conundrums and refine your reasoning ability. Brush up your programming skills. Take a deep breath. Relax, resume with your schedule.