Use c programming Use c programming Use c programming Use c programming No. Mark
ID: 3875567 • Letter: U
Question
Use c programming Use c programming Use c programming Use c programming No. Mark Single Choice Questions (2*10-20%) --, Which is the correct name of a variable in C language A. 3L C. size-lenglh 1. B. size.lengih D. lengrh3 2. An array a is initialized as: int a[]-:10.9. 8, 7,6); What is value of element a/ A. 6 ? B. 7 C. 8 D. 9 3. To use built-in function sin(x). which of the library should be included? D.ctime A. csidlib B. csldio C. cmath 4, which is the equivalent C statement of math formaularx 5. The symbol used to mark the beginning of comments is? A. What is the correct statements for open file data.txt for reading C. 6. 3treae input; ofstrean input; A. irput.open("aata.txt"; B. nput.open("data.txt isstrear input; ifstream input; C. input.fopen("data.tt) D. input.close("data.txt"); How the constants are declared? A. const keyword C. both const keyword and kdefine preprocessor Which looping process is best used when the number of iterations is known? 7. B. idefine preprocessor D. none of the mentioned S. B. while D, all looping processes nequire that the iterations be knoun Page lExplanation / Answer
Hello there,
1. As we can not start variable name with number and can not use '.' or '-' in variable name so length3 is correct option for a variable name.
2. In c , array indexing starts from 0 so value of a[4] will be 6 .
3. As these maths functions are available in cmath library so this is the correct answer.
4. option b is correct answer as it is used correct formula according to C programming.
5. In C, we use /* as begining of comment and end it with */ .plz choose option accordingly because your options are not clearly visible to me.
6. option C is correct., we use fopen() to read file.
7. Option C is correct , because we can use both to define constants.
8. when number of iterations are known, then FOR-LOOP is better option, so option A is correct.
9. option B is correct, as we pass float as parameter and function returning an integer type.
Hope, you got the answers, feel free to ask any doubt.
Thank you
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.