Skip to main content

C Language

Introduction

The C program you write is called source code. A compiler translates C source code into machine language. Computers are made up of nothing more than thousands of electrical switches that are either on or off. Therefore, computers must ultimately be given instructions in binary. The prefix bi- means “two,” and the two states of electricity are called binary states. It’s much easier to use a C compiler to convert your C programs into 1s and 0s that represent internal on and off switch settings than for you to do it yourself.

Basic Steps To Follow When Writing A Program

1. Decide exactly what the program should do.
2. Use an editor to write and save your programming language instructions. An editor lets you create  
 and  edit text. 
3.All the popular C compilers include an integrated editor along with the programming language compiler. 
4.All C  program filenames end in the .c file extension.
5. Compile the program.
6. Check for program errors. If any appear, fix them and go back to step 5.
7. Execute the program.

READ ME !!

* C programming has several inbuilt library functions to perform input and output tasks.
 The two commonly used functions for input/output tasks are....

      a) printf()
      b) scanf()
 
* The scanf() function reads formatted information from standard input(keyboard).
* The printf() function sends formatted output to the standard output (screen).


* Header File is a file that contains function declaration and macro definition for c in-built library
All C standard library functions are declared in many header files which are saved as file_name.h 
We are including these header files in our C program using “#include <file_name.h>” command to make use of the functions those are declared in the header files.

 When we include header files in our C program using “#include <filename.h>” command, all C         code of the header files are included in C program. Then, this C program is compiled by compiler  and executed.

* #include<stdio.h>
it represents standard input/output function which contains printf(), scanf() functions.

* #include<conio.h>
conio. h stands for console input and output header file. This is a library function which is used for output and input functions.

 The symbol # is known as preprocessor 

 Include is a directory and all the header files like stdio.h , conio.h are kept.

* clrscr(): [clear screen]
This is used to clear previous output in the output window. If you don't use it in your program then the  output window will become messy.


* getch(): [hold screen]
This function is used to hold the output window, otherwise when we run code it will display the output for just a fraction of seconds.








Comments

Popular posts from this blog

Java Programs

  Q. Write a program to print first letters of each word in a string if it is a vowel.  Explanation: Let us consider a string "Ellen is my cousin's friend"  In the above string 'E' 'i' are first letters of string and it is vowel so it should print the two letters. Program:    import java.util.Scanner; public class Main{ public static void main(String[] args) {     Scanner sc=new Scanner(System.in);     String st=sc.nextLine();     String Words[]=st.split(" ");     for(int i=0;i<Words.length;i++){         String s=Words[i];         s=s.toLowerCase();      if(s.charAt(0)=='a'|| s.charAt(0)=='e'|| s.charAt(0)=='i'|| s.charAt(0)=='o'|| s.charAt(0)=='u'){          System.out.println(s.charAt(0));      }        } } }

TCS INTERVIEW EXPERIENCE [TR]

Questions In Technical Round-   1. Where are u from ? 2. About project. 3. Then she asked me About mini project. 4. Explain your mini project.  5. Some questions related to my mini project. 6 . OOPS Concepts. 7. In which languages you r good in.  8. How do u rate your self in that. 9.  Some basic questions from c like syntax of for loop n what is nested if else. 10. What are conditional statements.  11. Difference between call by value n call by reference 12. One question from Data Structures ( define Stack n it's operations )  13. As I have mentioned the workshops I have attended          they have asked me what did I learnt from those workshops n explain it.  14. Difference between c and python, c and c ++  15. Do you know SDLC ? 16. Explain any one model in SDLC.  17. Any certifications?  18. R u going to work at any location with in India? 19. Ok with night shifts?      ...

TCS INTERVIEW EXPERIENCE [HR]

Questions In HR Round -  1. Self introduction. 2. What do you know about TCS?  3. Who is the CEO of TCS ? 4. Tell me about your family background. 5. About   Relocation. 6. Tell me about your father. 7. What would you do if  I reject u ( I said I will try to find out why I was rejected n try to improve in those areas n again apply for the job in TCS)  9.  HR: What if I again reject u  [ This is just an example, elaborate it depending on the  job description ]    Me :  I have seen in job description that one should be a good team player n adaptive for this role , apart from my academics I'm a good team player n adaptive so I don't think I'll be rejected. HR: okay Ur documents will be verified before joining if we hire u. That's all... ALL THE BEST