Jul 2, 2012  C Aptitude Questions and answers with explanation
C Aptitude 23    Read more about how to prepare and write the C
Aptitude Exams?  Predict the output or error(s) for the
following:  C aptitude 23.1 void main(){ int res; res= 56>76 ?
return 0:return 1;  Answer: Compilation error.  Explanation: We
cannot use return keyword in conditional operator.  C aptitude
23.2 Note: here input for command line argument is, example 5 4
7 8 /* example.c */  int main(int argc, char *argv[])     int j;
j = argv[1] + argv[2] + argv[3] + argv[4];     printf("%d", j);
return 0; Answer: Error  Explanation: Command line arguments are
string types, we can't add or do the arithmetic operations on
string types in C, we have to convert the argv[] to the integer
types using atoi function.  C aptitude 23.3      int main()
int  num1 = 123;     float num2  = 123.0;     if(num1 == num2)
printf("num1 and num2 are equal");         printf("num1 and num2
are not equal");     return 0; Answer: num1 and num2 are e