July 7, 2021 in C and CPP
Which header file should be included to use functions like malloc() and calloc()?
1.2 Which header file should be included to use functions like malloc() and calloc()?
A) memory.h
B) stdlib.h
C) string.h
D) dos.h
July 7, 2021 in C and CPP
1.2 Which header file should be included to use functions like malloc() and calloc()?
A) memory.h
B) stdlib.h
C) string.h
D) dos.h
July 7, 2021 in C and CPP
1.1 Which of the following cannot be checked in a switch case statement?
A) Character
B) Integer
C) Float
D) enum
July 6, 2021 in C and CPP
c) Consider outline of ‘C’ program given below:
#Include suitable header files
void main()
{
suitable prototype of function interchange()
int a=10, b=20;
interchange(&a,&b);
printf(“a=%d b=%d”,a,b)
}
The function interchange() interchanges the values of the variables supplied to it. So the
output of the program is
a=20 b=10
Write suitable interchange() function. Also fill in the gaps of this program so that it
produces the desired output.
July 6, 2021 in C and CPP
b) Write a program to input a 3x3 matrix and to print its transpose.
July 6, 2021 in C and CPP
a) Write a suitable ‘C’ program to print the following structure.

the number of rows should be input from the user.
July 6, 2021 in C and CPP
c) Write a ‘C’ program to calculate the electricity bill using if..elseif, as per the following
details
* Given the number of units consumed, unit charges are as follows:
i) For first 50 units Rs. 0.50/unit
ii) For next 100 units Rs. 0.75/unit
iii) For next 100 units Rs. 1.20/unit
iv) For unit above 250 Rs. 1.50/unit
* Add fuel surcharge 20% and Govt. Tax 10% on bill to calculate the total bill.
July 6, 2021 in C and CPP
b) Write an interactive ‘C’ program to evaluate the series: 1 – 1/2 + 1/3 – 1/4 …±1/n, where n is entered from keyboard.
July 6, 2021 in C and CPP
a) Write a ‘C’ program to find the minimum of the 8 floating point numbers and its place in the array.
July 6, 2021 in C and CPP
c) Identify all the compound statements which appear in the following program segment:
{
sum=0;
do{
scanf(“%d”, &i);
if (i < 0)
{
i=-i;
++flag;
}
sum += i;
} while (i != 0);
}
July 6, 2021 in C and CPP
b) Develop a function to calculate sum of n even integers starting from a given even integer.