June 13, 2021 in C and CPP
Write a C function print_upper()
Write a C function print_upper() to prints its character argument in uppercase.
June 13, 2021 in C and CPP
Write a C function print_upper() to prints its character argument in uppercase.
June 13, 2021 in C and CPP
Write a C function word_count() to count the number of words in a given string and then
call in Main().
June 13, 2021 in C and CPP
What is printed after execution of each of the following C-programs?
June 13, 2021 in C and CPP
Write a ‘C’ program to calculate and display the monthly income of a salesperson
corresponding to the value of monthly sales input in the scanf() function, let us consider
the following commission schedule: (Note: use if-else statement)
Monthly Sales Income
Greater than or equal to Rs.50,000 375 plus 16% of sales
Less than Rs. 50,000 but
Greater than or equal to Rs. 40,000 350 plus 14% of sales
Less than Rs. 40,000 but
Greater than or equal to Rs. 30,000 325 plus 12% of sales
Less than Rs. 30,000 but
Greater than or equal to Rs. 20,000 300 plus 9% of sales
Less than Rs. 20,000 but
Greater than or equal to Rs. 10,000 250 plus 5% of sales
Less than Rs. 10,000 200 plus 3% of sales
June 13, 2021 in C and CPP
Write a C program that reads integers from the file scores.dat. After all the integers have
been read, the program writes the sum of all the nonnegative integers to the video
display. Assume that the file scores.dat contains at least one integer.
June 13, 2021 in C and CPP
Write the C program to write
“Introduction to C-Programming”
to the file outf.dat.
June 13, 2021 in C and CPP, News
Write the C Statements (all necessary statements) that open the file inf.dat for reading,
and open the file outf.dat for writing.
June 13, 2021 in C and CPP
1.10. Enumeration is:
A) A list of strings
B) A set of numbers
C) A set of legal values possible
D) None of the above
June 13, 2021 in C and CPP
1.9. Which of the following is true for the switch statement:
switch(var)
{
};
A) Can be used when only one variable is tested
B) The variable must be an integral type
C) Each possible value of the variable can control a single branch
D) All of the above
June 13, 2021 in C and CPP
1.8. Consider the following declarations.
union id {
char color;
int size;
}
struct {
char country;
int date;
union id i;
} flag;
To assign a color to a flag, the correct statement would be
A) flag.color = ‘W’;
B) flag.i.color = ‘W’;
C) flag.color = ‘White’;
D) flag.i.color = ‘White’;