Posts

c programming basic syntax

BASIC SYNTAX Tokens in C A C program consists of various tokens and a token is either a keyword, an identifier, a constant, a string literal, or a symbol. For example, the following C statement consists of five tokens: printf("Hello, World! \n"); The individual tokens are: printf ( "Hello, World! \n" ) ; Semicolons In a C program, the semicolon is a statement terminator. That is, each individual statement must be ended with a semicolon. It indicates the end of one logical entity. Given below are two different statements: printf("Hello, World! \n"); return 0; Comments Comments are like helping text in your C program and they are ignored by the compiler. They start with /* and terminate with the characters */ as shown below: /* my first program in C */ You cannot have comments within comments and they do not occur within a string or character literals. Identifiers A C iden

cdac ccat study material

Image
  How to register for C CAT of C DAC 2019  Admissions to all PG Diploma courses of C DAC are done through C DAC's computerized Common Admission Test (C CAT). Every year, C CAT is usually conducted in June (for August admissions) and December (for February admissions). cdac ccat study material C-CAT has three sections (Section A, Section B, Section C) of one-hour duration each. As shown in Table 1, depending on the category of courses selected by the candidate, he/she will have to either appear for just one test paper (Section A) or two test papers (Section A and Section B) or all the three test papers (Section A, Section B and Section C). The medium of C-CAT is English. Important Note: A candidate can appear only for the specific section(s) in C-CAT as per the category of the courses opted by him/her at the time of filling the online application form. Every section in  Pre DAC  will have 50 objective-type questions. Each question will have four choices as possible answe

C Programming layout and Structure

3. PROGRAM STRUCTURE Hello World Example A C program basically consists of the following parts: o    Preprocessor Commands o    Functions o    Variables o    Statements & Expressions o    Comments Let us look at a simple code that would print the words "Hello World": #include <stdio.h> int main() { /* my first program in C */ printf("Hello, World! \n"); return 0; } Let us take a look at the various parts of the above program: 1.        The first line of the program #include <stdio.h> is a preprocessor command, which tells a C compiler to include stdio.h file before going to actual compilation. 2.        The next line int main() is the main function where the program execution begins. 3.        The next line /*...*/ will be ignored by the compiler and it has been put to add additional comments in the program. So such lines are called comments in the program. Compile and Execute C Prog