Important points about C Language Function

Key Points

We know that Function is very Important part of C Language. With the help of Function Programs are easy to write and understand. So there are some Key points to remember when deal with C Language Function: 

  • A Function gets called when the Function name is followed by a semicolon(;).

Example:

int main()
{
india();                 /* Function calling */
}

  •  A Function can call itself. Such a process is called “recursion”. Discuss later.

    • A Function can be called from another Function, but a Function cannot be defined in another Function.
    Example:
    int main()
    {
    printf(” Hello”);
    void india()                                /* Function definition */
    {
    printf(” I am in India”);
    }

    The above Program code would be wrong because india() is being defined inside another Function main().


    • A Function can be called any number of times.
    Example:
    #include<stdio.h>
    void india();                          /* Function Declaration */
    int main()
    {
    india();                                 /* Function Calling */
    india();                                 /* Function Calling */
    return(0);
    }
    void india()                           /* Function Definition */
    {
    printf(” Hello\n”);
    }

    • The order in which the Functions are defined in a Program and the order in which they get called need not necessarily be same.
    Example:
    #include<stdio.h>
    void India();                                      /* Function Declaration */
    void England();                                  /* Function Declaration */
    int main()
    {
    India();                                             /* Function Calling */
    England();                                         /* Function Calling */
    return(0);
    }
    void England()                                   /* Function Definition */
    {
    printf(” Olympic games”);   
    }
    void India()                                        /* Function Definition */
    {
    printf(” Beautiful city of corruption”);
    }
    India() is getting called before England(), still India() has been defined after England().

    • Any Function can be called from any other Function.
    Example:
    #include<stdio.h>
    void India();                         /* Function Declaration */
    int main()
    {
    India();                                /* Function Calling */
    return(0);
    }
    void India()                          /* Function Definition */
    {
    printf(” Nasa Mars mission successufull”);
    main();                               
    }

    • A Function is defined when Function name is followed by a pair of braces in which one or more statements may be present.
    Example:
    void India()                      /* Function Definition */
    {
    stmt 1;
    stmt 2;
    }
                                                                     That's All 

    How to Crack a Job interview Successfully [Top 15 Tips and Tricks]

    Job Interview
    To have a successful interveiw and to make a lasting impression, the Body Language is very important. Postures and body movements are unconsious forms of expression and therefore they have a language of their own. We are unaware of our gestures and body movements most of the time, but other people can notice our gestures and movements if they pay attention and know what they mean.
                                                            An important thing to be noted here is that body language applies not only to the Interviewer but also to the Interviewee. Also, note that these gestures may happen throughout the conversion or a discussion and they change as the conversation progresses.

    Interview Skills
    The objective of paying attention to nonverbal communication is to help you change the direction of the conversation. If the person is showing negative gestures; then you need to change the topic by asking a new questions or talking about something else.
    Here is a comprehensive list of probable body gestures, which you watch out for during the course of a Job interview :
    • Crossed arms means that person is in a defensive and reserved mood.
    • Crossed arms and legs means that the person is feeling very reserved and suspicious.
    • Open arms and hands means that the persion is open and receptive.
    • Standing before you with hands inside the pockets means he is not sure or fells suspicious.
    • Standing before you with hands on hips means he is receptive and ready to help you out.
    • Rubbing the back of head or touching the back of neck means the conversation is not really interesting.
    • Leaning back in chair with both hands clasped behind head means he is in an analytical mood, but it is also a gesture of superiority.
    • With the palm holding or supporting chin, he is in an evaluating position and being critical.
    • Sitting in a chair shaking one of the legs means he feels nervous and uncomfortable.
    • Rubbing or touching nose when asking a question means he is not telling the complete truth.
    • If the eyes are downcast and face turned away, it means he is not interested in what you are saying.
    • If he moves his body and sits with his feet and body pointing towards a door means he wants to end the conversation and leave the room.
    • If you are nervous try not to show it.
    • Don't play with your watch, clothes, bag etc. Try to maintain eye contact with the interviewer. 
    • Last but not the least, donot underestimate the importance of your posture and subtle movements.

    At Present, we have seen in the Newspapers, Internet and Heard in the TV that in almost all fields of Work , there is a tough competition between the Students , Employees , Workers etc. Everyone tries to become Successfull in the field where they work but during Interviews , if you pay Little attention towards these above small things than probably you might have a Successfull Interview.

                                                                      
                                                                     All the best!

    WAP to determine whether the Number is Prime or Not by using while and if Statement

    C break Statement

    Break Statement:

    There are many situations where we want to jump out of a loop instantly. The keyword break allows us to do this. When break is encountered inside any loop, control automatically passes to the first statement after the loop. So Let us understand the break statement with the help of Program :-
    Statement of C Program: This Program accepts a number and determined whether the number is Prime or not.
    Prime Number:
    A Prime number is one, which is divisible by 1 or itself.  Ex: 3 , 5 , 7 , 11 , 13 , 17 , 23 , 19 etc.
    #include<stdio.h>
    #include<conio.h>
    void main()
    {
    int a , b ;
    clrscr();
    printf(” Enter the value of a\n”);
    scanf(“%d” , &a);
    b = 2;
    while( b <= a-1 )
    {
    if(a % b == 0)
    {
    printf(” Entered Number is not Prime\n”);
    break;
    }
    b = b + 1;                                                   /*   b++     or    b += 1   */
    }
    if(b = a)
    {
    printf(” Prime Number\n”);
    }
    getch();
    }
    Output1:
    Enter the value of a
    7
    Prime Number
    Output2:
    Enter the value of a
    9
    Entered Number is not Prime

    Explanation:

    • In the above Program, if the condition { i.e a % b } turns out to be zero, then the message “ Entered number is not Prime ” is printed and after that the break statement encountered which causes control out of while loop.
    • If the condition { i.e b == a } is true, then the message ” Prime Number ” is printed.
                                                                          
                                                                        That's All

    WAP of C Language that calls many Functions

    C Function Program

    Statement of C Program : This Program prints the Messages or Instructions when different Functions calls: 

    #include<stdio.h>

    void England();                                      /* Function declaration */
    void Australia();                                     /* Function declaration */
    void India();                                           /* Function declaration */
    int main()
    {
    printf(” I am in main\n”);
    England();                                                 /*  Function call */
    Australia();                                                /*  Function call */
    India();                                                      /* Function call */
    return(0);
    }
    void England()                                             /* Function definition */
    {
    printf(” I am in England\n”);
    }
    void Australia()                                             /* Function definition */
    {
    prinf(” I am in Australia\n”);
    }
    void India()                                                   /* Function definition */
    {
    printf(” I am in India\n”);
    }
    Output:
    I am in main
    I am in England
    I am in Australia
    I am in India
    Note:  Number of Conclusions drawn from the above Program:
    • A C Program is a collection of one or more Function or you can say A Function is a basic building block of C program.
    • If a C program contain only one Function, then it must be main(), because Program execution always begins with main().
    • In C program, as many number of Functions exist i.e there is no limit on the number of Functions.
    • Control returns to main() after each Function has doing its work or thing.
    • The Program ends, when main() runs out of statements and Function calls.

                                                                   

                                                                     That's All

    Write a Simple C Function Program that prints the Messages i.e Good Morning? & Good Evening!

    Messages

    Statement of C Program: This Program prints the Messages i.e Good Morning? & Good Evening! with the help of Function :

    This is the Simplest C Function Program. Functions are the basic building blocks of C Program.

    #include<stdio.h>

    void msg();                                            /* Function Declaration */

    int main()

    {
    msg();                                                         /* Function Call */
    printf(” Good Morning?”);
    return(0);
    }
    void msg()                                               /* Function Definition */
    {
    printf(” Good Evening!”);
    }
     Output:
     Good Evening!
     Good Morning?
    Explanation:
    Above, we have defined two Functions- main() and msg(). We have used the word msg at three places in the Program. So Let us understood the meaning of each.
    1. 
    void msg();
    This Function declaration indicates that msg() is a Function which after completing its execution does not return anything. The keyword void is used before the msg() to indicate that it 'does not return anything'.
    2.
    void msg()
    {
    printf(” Good Evening”);
    }
    This is Function definition. In this definition we are using only printf(), but we can also use for , switch , if , while etc inside Function definition.
    3. 
    msg();
    The Function msg() is being called by main() i.e main() calls the function msg(). We mean that control passes to the function msg().
                                                                           That's All