Correct Answer: Cohesion is the OO principle most closely associated with making sure that a class is designed with a single, well-focused purpose
Explanation:
A refers to encapsulation, B refers to coupling
5. What is the output of this C code? #include int main() { int a = 1, b = 1; switch (a) { case a*b: printf("yes "); case a-b: printf("non"); break; } }
Correct Answer: atoi() Converts a string to an integer itoa() Convert an integer to a string gcvt() Converts a floating-point number to a string #include "stdlibh" main() { char s[] = "12345"; char buffer [15], string[20]; int i; i = atoi (s); printf("\n%d",i); gcvt (20141672, 4, buffer); printf ("\n%s", buffer); itoa(15, string,2); printf ("\n%s", string); }