BIT102Semester I10 units84 solved questions1,003 study cardsFull study modes
The free sample is open to everyone. Sign in for 2 free weeks of every answer, flashcards and progress.
This chapter introduces the building blocks of every C program. You learn how a program is laid out, how it becomes a running file, and which words and names C allows.
A C program is a set of functions. Execution always starts from the main() function. A typical program has these parts in order:
#include lines that bring in header files.#define.main() function with its declarations and statements.main().#include <stdio.h>
#define PI 3.14159
int main(void)
{
float r = 2.0f, area;
area = PI * r * r;
printf("Area = %.2f\n", area);
return 0;
}
The return 0; statement tells the operating system that the program ended without error. Every statement ends with a semicolon, and a block of statements is enclosed in braces { }.
C is a compiled language. The source file (.c) must be changed into machine code before it can run. This happens in four stages:
.o or .obj).printf, to make one executable file.With the GCC compiler, the commands look like this:
gcc hello.c -o hello
./hello
Syntax errors are found at compile time. Errors such as a missing library function are found at link time. Errors such as division by zero appear only at run time.
C Programming for TU BIT is covered here in full, from syllabus notes to solved past questions. This subject has 10 chapters mapped to the official syllabus, and 84 past exam questions with written model answers. The opening of every note and answer is free, and the most-searched questions are free in full. A free account gets 2 free weeks of the whole program plus flashcards and progress tracking so weak topics come back before the exam.
This TU BIT C Programming guide covers Fundamentals of C Programming, Data Types and Constants, Operators and Expressions, Control Structures, Loops and Iteration, Arrays and Strings, Functions and Recursion, Pointers and Dynamic Memory, and more, across 10 chapters. It includes model answers to 84 past exam questions, plus flashcards for quick revision.
C Programming has 10 chapters mapped to the official syllabus.
Yes. Each of the 84 past questions comes with a written model answer; the most-searched ones are free in full, the rest open with a free account's 2 free weeks or a pass.
Free to start. The opening of every note and answer is free, the most-searched questions are free in full, and a free account gets 2 free weeks of the whole program plus flashcards and progress tracking. After that a program pass keeps everything open.
Based on the official syllabus.