100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached
logo-home
PRF192 Questions and Answers 2024 $7.99   Add to cart

Exam (elaborations)

PRF192 Questions and Answers 2024

 1 view  0 purchase
  • Course
  • Institution

PRF192 Questions and Answers 2024 In C, correct order(s) of a function implementation: Choose at least one answer. a. Return type, body, function name, parameters b. Return type, body, parameters, function name c. Return type, function name, parameters, body d. Return type, parameters, bo...

[Show more]

Preview 4 out of 112  pages

  • August 11, 2024
  • 112
  • 2024/2025
  • Exam (elaborations)
  • Questions & answers
avatar-seller
PRF192 Questions and Answers 2024
In C, correct order(s) of a function implementation:
Choose at least one answer.
a. Return type, body, function name, parameters
b. Return type, body, parameters, function name
c. Return type, function name, parameters, body
d. Return type, parameters, body, function name ** Answ** C

Once the function ends, the control is returned back to the ... function and execution
continues from the statement immediately after the function call
a. executing
b.called
c.declared
d.calling ** Answ** A

When does the code block following while(x<100) execute?
a.when x is less than one hundred
b.when x is equal to one hundred
c.when x is greater than one hundred
d.while it wishes ** Answ** A

What number is equivalent to -4e3?
a.-4000
b.-400
c..004
d..0004
e.-40 ** Answ** A

Declare a two dimensional integer array of two rows and four columns having some
initial values
a.int arr1[4][2]={{8,12},{22,45},{23,40},{44,79}}
b.int arr1[2][4]={{8,12},{22,45},{23,40},{44,79}}
c.int arr1[4][2]={{8,12};{22,45};{23,40};{44,79}}
d.int arr1[][2]={{8,12},{22,45},{23,40},{44,79}} ** Answ** A

A string is a ... array of characters terminated by a null('\0')
a.one-dimensional
b.two-dimensional ** Answ** A

Consider the following code:
if(a==b)
printf("\n the number are equal");
else(a<b)

,printf("\n the smaller number is: %d",a);
else
printf("\n the smaller number is: %d",b);
in the above code, if a=14 and b=9, then the .... clause is executed
a. else
b.if
c else if ** Answ** A

The while loop can be written as a for loop
a.TRUE
b.FALSE ** Answ** A

A comment can be split over more than one line, as follows
/** A program
to calculate average
of 5 numbers. **/
a.TRUE
b.FALSE ** Answ** A

Using break statement we can exit from
a. for a loop
b. an if statement
c. the main() function
d. a program ** Answ** A

What is the output when the sample code below is executed?
char mess[]="Your are welcome here";
char *p;
p=mess;
mess[8]='\0';
puts(++p);
a.our are wel
b.our are
c.Your are
d.Your are wel ** Answ** A

Which of the following statement are true with regards to the || operator?(select al
correct answer)
A. this operator is used to combine two conditional expressions which evaluate to true
as a whole only if either of the two expressions evaluate to true.
B. only if both the expressions evaluate to false, the outcome is false
C. if one of the conditional expressions return false, the outcome is false
D. this operator is used to combine two logical expressions which evaluate to true if
both individual expression are true
e. a & b ** Answ** E

,What is the incorrect statement about floating-point data types(float and double)?
a. computers store floating-point data using separate components, including the
mantissa and exponent
b.float-point means that the decimal point can float(that is, it can ba placed anywhere
relative to the significant digits)
c.both data types(float and double) can represent arbitrarily small as well as arbitrarily
large numbers
d.none of the above ** Answ** B

In myfile.c does not exist, what will be output of this program?
#include<stdio.h>
main(){
FILE *fi;
fi=fopen("myfile.c","r");
if(fi=NULL)
{puts("file is not opened");
exit(1);}
else
puts("FILE opened");}
a. file is not opened
b.no output
c.FILE opened
d.error ** Answ** B

What does the following declaration mean (if there are more than one correct answers,
choose the best one)
int *ptr[10];
a.array of 10 integer pointers
b.pointed to the array of 10 elements
c.array of 10 pointers ** Answ** B

Which one of the following is a variable, which can contain the address of the memory
location of another variable?(choose the best answer)
a.string
b.struct
c.array
d.pointer ** Answ** B

How is a variable accessed from another file?
a. the global variable is referenced via the auto specifier
b. the global variable is referenced via the extern specifier
c. the global variable is referenced via the pointer specifier
d. the global variable is referenced via the ext specifier
e. the global variable is referenced via the global specifier ** Answ** B

Which option is correct about the function scanf?

, a.EOF indicates that scanf filled all addresses successfully
b. scanf returns the number of addresses successfully filled of EOF
c.return avoid type ** Answ** B

What value will x contain in the sample code below?
int x=011|0x10;
a.27
b.19
c.25
d.13
e.3 ** Answ** C

Which of the following can be used to append one string at the end of another
a.strcpy
b.strcmp
c.strcat
d.none of the above ** Answ** C

According to the standard C specification, what are the respective minimum sizes (in
bytes) of the following two data type: int and long?
a.2,8
b.4,8
c.2,4
d.2,2 ** Answ** C

Which ARE the following statements printf % character?
a.printf("\%")
b.printf("\\%")
c.printf("\%%") ** Answ** C

Which one of the following is a valid function definition?
a. double funct(int a,b, double c,d)
b. double funct(int a,b, double c)
c. double funct(char a,b, double d)
d. double funct(int a,int b, double c) ** Answ** D

The operation between float and int would give the result as
a. float
b. int
c. unsigned int
d.none of the above ** Answ** D

The precedence of operators is ___
A. Arithmetic, Comparison, Logical
B. Logical, Comparison, Arithmetic
C. Comparison, Arithmetic, Logical

The benefits of buying summaries with Stuvia:

Guaranteed quality through customer reviews

Guaranteed quality through customer reviews

Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.

Quick and easy check-out

Quick and easy check-out

You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.

Focus on what matters

Focus on what matters

Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!

Frequently asked questions

What do I get when I buy this document?

You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.

Satisfaction guarantee: how does it work?

Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.

Who am I buying these notes from?

Stuvia is a marketplace, so you are not buying this document from us, but from seller smartchoices. Stuvia facilitates payment to the seller.

Will I be stuck with a subscription?

No, you only buy these notes for $7.99. You're not tied to anything after your purchase.

Can Stuvia be trusted?

4.6 stars on Google & Trustpilot (+1000 reviews)

78310 documents were sold in the last 30 days

Founded in 2010, the go-to place to buy study notes for 14 years now

Start selling
$7.99
  • (0)
  Add to cart