Fundamentals of C Language - General Knowledge Question and Answer

Fundamentals of C Language - Question and Answer

Before execution compiler converts high-level program into machine language program, the machine language program is called  


Source program
Object program
exe program
None of this

Answer:

Object program

Share Me:

C – language is used for  


System Programming
Application Programming
Both A and B
Neither A nor B

Answer:

Both A and B

Share Me:

Write a function to swaps the values of two integers.  


No solution exist.
Solution need 2 extra variables
Solution exist without any extra variables
Solution need 1 extra variable

Answer:

Solution c Solution exist without any extra variables
1.
void swap(int a, int b)
{
int c;
c=a;
a=b;
b=c;
}
2.
void swap (int a, int b)
{

a=a+b;

b=a-b;

a=a-b;

}
Solution2 is the best solution since no extra variable is required.

Share Me: