Category: CLA – Programming Essentials in C
There is no best programming language. Each language is better than others for certain things, and which one you are using depends on what you want to do with it. Having said that, the fact remains, though, that the world runs on C and C++. People use numerous …
1. What is the value of the following integer literal? 017 17 15 23 the literal is invalid 2. What is the value of the following integer literal? 0x17 15 17 the literal is invalid 23 3. Which of the following strings is a valid variable name? none …
1. Which of the following strings is a proper integer number (in the “C” language sense)? 3141592 3,141592 3_141_592 3.141592 2. What is the value of the following integer literal? 012 10 12 the literal is invalid 18 3. What is the value of the following integer literal? …
1. What happens if you try to compile and run this program? #include <stdio.h> #define ALPHA -2 int main(void) { int i = -1; i += ALPHA; printf("%d",i); return 0; } the program outputs -1 the program outputs -2 the program outputs -3 the program outputs 0 2. …
1. The following string: JohnDoe is a valid file name in MS Windows systems Unix/Linux systems 2. Unix/Linux systems treat the following names JohnDoe johndoe as identical file names as different file names 3. The following string: HomeDir/HomeFile is a valid file name in: MS Windows systems Unix/Linux …
1. What happens if you try to compile and run this program? void f(void) { } int main(void) { int i; i = f(); printf("%d",i); return 0; } the program outputs nul compilation fails the program outputs NULL the program outputs 0 2. What happens if you try …
1. What happens if you try to compile and run this program? #include <stdio.h> int main(void) { char s = "ABCDE", *p = s + 3; printf("%d", p - p); return 0; } the program outputs 1 the program outputs 4 the program outputs 2 the program outputs …
1. What happens if you try to compile and run this program? #include <stdio.h> int main(void) { int i = 3, j = i - 2; switch(i - 2) { case 1: j++; case 2: j++; case 0: j++; break; default:j = 0; } printf("%d",j); return 0; } …
1. What happens if you try to compile and run this program? #include int main(void) { int i, j, k; i = -1; j = 1; if(i) j--; if(j) i++; k = i * j; printf("%d",k); return 0; } the program outputs2 the program outputs -1 the program …
1. Which of the following strings is a proper integer number (in the āCā language sense)? 123456 123_456 123.456 123,456 2. What is the value of the following integer literal? 08 the literal is invalid 10 1000 8 3. What is the value of the following integer literal? …