Font size
WorksheetsUnderstanding C Programming Basics
Total questions: 65
Worksheet time: 54mins
What does C stand for in the C programming language?
C++
C#
C
C Language
Who developed the C programming language?
Bjarne Stroustrup
Dennis Ritchie
Linus Torvalds
James Gosling
What is the file extension for C source files?
.cpp
.java
.py
.c
What is the purpose of the main() function in C?
The main() function is used for defining global variables.
The main() function is where all the functions are declared.
The main() function is responsible for memory allocation.
The main() function is the entry point of a C program.
How do you declare a variable in C?
var x int;
To declare a variable in C, use the syntax: type variable_name; e.g., int x;.
int x = 5;
declare int x;
What is the difference between int and float in C?
int can store decimal values, while float cannot.
int represents whole numbers, while float represents decimal numbers.
float is used for character data, while int is for numeric data.
int and float are interchangeable in C programming.
What is a pointer in C?
A pointer is a constant value in C.
A pointer is a variable that holds the address of another variable in C.
A pointer is a variable that stores a string in C.
A pointer is a type of function in C.
How do you create a comment in C code?
Use '//' for single-line comments and '/* ... */' for multi-line comments.
Use '//' for multi-line comments
Use '#' for comments
Use '/*' for single-line comments
What is the use of the #include directive?
To comment out sections of code.
To specify the programming language used in the file.
To define a new function in the source code.
To include the contents of a file or library in the source code.
What is an array in C?
A pointer to a memory address
A variable that can hold multiple data types
A function that returns a single value
An array in C is a collection of elements of the same type stored in contiguous memory locations.
How do you define a function in C?
return_type function_name(parameter_type parameter_name) { // function body }
return_type { function_name(parameter_type parameter_name) }
function_name { return_type parameter_type parameter_name }
function_name(parameter_type) return_type { // body }
What is the purpose of the return statement?
To comment out a section of code.
To exit a function and optionally return a value to the caller.
To define a variable within a function.
To create a loop in the code.
What are control structures in C?
Control structures in C include conditional statements and loops that control the flow of execution.
Functions and procedures
Data types and variables
Memory management techniques
What is the difference between while and for loops?
'While' loops are always faster than 'for' loops regardless of the situation.
The main difference is that 'for' loops are used for a known number of iterations, while 'while' loops are used for an unknown number of iterations based on a condition.
'For' loops require a condition to run, while 'while' loops do not.
'For' loops can only iterate over arrays, while 'while' loops cannot.
How do you handle errors in C?
Use return values, errno, and custom error handling functions.
Ignore errors completely
Always print error messages to the console
Use global variables for error tracking
What is a structure in C?
A structure in C is a built-in data type for integers.
A structure in C is a function that performs operations on data.
A structure in C is a way to define constants in a program.
A structure in C is a user-defined data type that groups different data types.
What is the significance of the semicolon in C?
The semicolon indicates a comment in C.
The semicolon signifies the end of a statement in C.
The semicolon is used to declare variables in C.
The semicolon is used to define functions in C.
How do you allocate memory dynamically in C?
Use 'free' to allocate memory
Use 'sizeof' to allocate memory
Use 'printf' to allocate memory
Use 'malloc', 'calloc', or 'realloc' functions from stdlib.h to allocate memory dynamically.
What is the use of the sizeof operator?
The sizeof operator calculates the total memory usage of a program.
The sizeof operator returns the size of a data type or object in bytes.
The sizeof operator is used to define new data types.
The sizeof operator converts data types to their string representations.
What are the standard libraries available in C?
Pada skrip program, void setup merupakan....
program akhir
program yang ditengah
serial program
awal program
tanda ; (titik koma) merupakan ...
awal program
akhir program
akhir setiap baris program
menentukan awal program
kode program yang digunakan untuk menyimpan suatu nilai pada sebuah nama adalah ...
variabel
integer
boolean
float
Pada operator matematika perkalian menggunakan simbol...
+
x
*
/
Apakah fungsi dari scanf ?
Menampilkan hasil input
Menampilkan hasil output
Mengeksekusi program
Menghilangkan variabel
Apakah fungsi dari tipe data char?
Menulis karakter
Menulis nilai huruf
Memberikan efek
Memberi warna
Apakah fungsi dari tipe data string?
Untuk teks
Untuk angka
Untuk bilangan
Untuk nilai
Penulisan header pada program diawali dengan....
#include
Int main
Getch();
iostream
Merupakan proses menerjemahkan bahasa manusia kedalam bahasa yang dimengerti komputer disebut ?
Debug
Compile
Expent
Header
Suatu tempat untuk menampung nilai atau data yang dapat berubah-ubah disebut?
define
Shorting
Main
variabel
Yang bukan tipe data yang bersifat numerik adalah ...
Float
Long
Char
Short
Suatu bilangan yang nilainya tetap adalah?
konstanta
konstitusi
konichiwa
konbanwa
Dibawah ini merupakan tipe data bilangan bulat....
Int
Char
String
Cin
Float
Relasi > menunjukkan
Lebih besar daripada
Lebih kecil dsripada
Sama dengan
Tidak samadengan
Perhatikan contoh program berikut. fungsi #include <> pada program tersebut adalah untuk …
Memanggil variabel
Memanggil fungsi utama
Memanggil pustaka/library
Memanggil komentar
Merupakan proses menterjemahkan bahasa manusia kedalam bahasa yang dimengerti komputer disebut?
Debug
Compile
Run
Error
Hasil = a*b; merupakan
Penjumlahan
Pembagian
Pengurangan
Perkalian
Bahasa Pemrograman C adalah
Sebuah bahasa Pemrograman Komputer yang bisa digunakan untuk membuat berbagai aplikasi
Sebuah bahasa Pemrograman Komputer yang bisa digunakan untuk menerjemahkan Bahasa
Sebuah bahasa Pemrograman Komputer yang bisa digunakan untuk membuat Diagram Alir
ebuah bahasa Pemrograman Komputer yang bisa digunakan untuk membuat Desain
Bahasa Pemrograman C dibuat Pertama kali Oleh
Pada tahun berapa Bahasa C dibuat untuk pertama kali??
dibawah ini yang tidak merupakan bahasa pemrograman adalah
C
fungsi Source Code #include <stdio.h> di bahasa c adalah
fungsi source code Printf
dalam bahasa c adalah
fungsi source code \n
dalam bahasa c adalah
Output dari Source code di samping adalah
Print (" Hello Word\n")
(" Hello Word\n")
Hello Word\n
Hello Word
dibawah ini yang merupakan simbol komentar di bahasa c adalah
{}
dari Source code di samping apabila Variabel A di input nilai 8 dan Variabel B di input nilai 4 hasilnya adalah
8
12
16
4
Penulisan header pada program diawali dengan....
#include
Int main
Getch();
iostream
tanda ; (titik koma) merupakan ...
awal program
akhir program
akhir setiap baris program
menentukan awal program
Bahasa Pemrograman C adalah
Sebuah bahasa Pemrograman Komputer yang bisa digunakan untuk membuat berbagai aplikasi
Sebuah bahasa Pemrograman Komputer yang bisa digunakan untuk menerjemahkan Bahasa
Sebuah bahasa Pemrograman Komputer yang bisa digunakan untuk membuat Diagram Alir
ebuah bahasa Pemrograman Komputer yang bisa digunakan untuk membuat Desain
Bahasa Pemrograman C dibuat Pertama kali Oleh
Pada tahun berapa Bahasa C dibuat untuk pertama kali??
dibawah ini yang tidak merupakan bahasa pemrograman adalah
C
fungsi Source Code #include <stdio.h> di bahasa c adalah
fungsi source code Printf
dalam bahasa c adalah
fungsi source code \n
dalam bahasa c adalah
Output dari Source code di samping adalah
Print (" Hello Word\n")
(" Hello Word\n")
Hello Word\n
Hello Word
