Note : All the programs are tested under Turbo C/C++ compilers. It is assumed that, Programs run under DOS environment. Program is compiled using Turbo C/C++ compiler. The program output may depend on the information based on this assumptions (for example sizeof(int) == 2 may be assumed).
Author: Mohit Arora
Looping questions and answers with explanation for written test exam and interview in c programming language. Following are the some basic tricky questions in C language. What will be output of following c code? #include<stdio.h> extern int x;
/* Write a C program to find the sum of odd numbers and * * sum of even numbers from 1 to N. Output the computed * * sums on two different lines with suitable headings */
The call by reference method of passing arguments to a function copies the reference of an argument into the formal parameter. Inside the function, the reference is used to access the actual argument used in the call. This means that changes made to the parameter affect the passed argument.
The call by pointer method of passing arguments to a function copies the address of an argument into the formal parameter. Inside the function, the address is used to access the actual argument used in the call. This means that changes made to the parameter affect the passed argument.
Using call by value method, only the copies of actual arguments is passed to the called function. By default, C++ uses call by value to pass arguments . The call by value method of passing arguments to a function copies the actual value of an argument into the formal parameter of the function.