My Courses
C Programming Questions and Answers – Arithmetic Operators
C Programming Questions and Answers – Arithmetic Operators 1.What is the output of this C code? #include <stdio.h> int main() { int i = -3; int k = i % 2; printf(“%d\n”, k); } a) Compile time error b) -1 c) 1 d) Implementation defined 2.What is the output of this C code? #include…
C Programming Questions and Answers – Increment and Decrement Operators
C Programming Questions and Answers – Increment and Decrement Operators 1.What is the difference between the following 2 codes? #include <stdio.h> //Program 1 int main() { int d, a = 1, b = 2; d = a++ + ++b; printf(“%d %d %d”, d, a, b); } #include <stdio.h> //Program 2 int main() { int…
C Programming Questions and Answers – Type Conversions
C Programming Questions and Answers – Type Conversions 1.What is the output of this C code? #include <stdio.h> void main() { float x = 0.1; if (x == 0.1) printf(“studyhelpzone”); else printf(“Advanced C Classes”); } a) Advanced C Classes b) studyhelpzone c) Run time error d) Compile time error 2.Comment on the output…
C Programming Questions and Answers – Relational & Logical Operators
C Programming Questions and Answers – Relational & Logical Operators 1.What is the output of this C code? #include <stdio.h> void main() { int x = 1, y = 0, z = 5; int a = x && y || z++; printf(“%d”, z); } a) 6 b) 5 c) 0 d) Varies 2.What is…
C Programming Questions and Answers – Declarations
C Programming Questions and Answers – Declarations – 1 1.What is the output of this C code? #include <stdio.h> void foo(const int *); int main() { const int i = 10; printf(“%d “, i); foo(&i); printf(“%d”, i); } void foo(const int *i) { *i = 20; } a) Compile time error b)…
C Programming Questions and Answers – Constants
C Programming Questions and Answers – Constants 1.What is the output of this C code? #include <stdio.h> int main() { enum {ORANGE = 5, MANGO, BANANA = 4, PEACH}; printf(“PEACH = %d\n”, PEACH); } a) PEACH = 3 b) PEACH = 4 c) PEACH = 5 d) PEACH = 6 2.What is the output…
C Programming Questions and Answers – Data Types and Sizes – 2
C Programming Questions and Answers – Data Types and Sizes – 2 1.Comment on the output of this C code? #include <stdio.h> int main() { float f1 = 0.1; if (f1 == 0.1) printf(“equal\n”); else printf(“not equal\n”); } a) equal b) not equal c) Output depends on compiler d) None of the mentioned 2.Comment…
C Programming Questions and Answers – Data Types and Sizes – 1
C Programming Questions and Answers – Data Types and Sizes – 1 1.Comment on the output of this C code? #include <stdio.h> int main() { int a[5] = {1, 2, 3, 4, 5}; int i; for (i = 0; i < 5; i++) if ((char)a[i] == ‘5’) printf(“%d\n”, a[i]); else printf(“FAIL\n”); } a) The compiler…
Computer Organization And Architecture Multiple Choice Questions on Performance of a System
This set of Computer Organization and Architecture MCQ focuses on “Factors affecting performance of the system and its measurement”. 1.During the execution of the instructions, a copy of the instructions is placed in the ______ . a) Register b) RAM c) System heap d) Cache 2. Two processors A and B have clock frequencies of…
Computer Organization and Architecture MCQ on BUS Structure
This set of Computer Organization and Architecture MCQ focuses on “Bus Structure”. The main virtue for using single Bus structure is , a) Fast data transfers b) Cost effective connectivity and speed c) Cost effective connectivity and ease of attaching peripheral devices d) None of these ______ are used to over come the difference in…