100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached
logo-home
CSCI-0046 Systems Programming in Linux – MIDTERM Questions With Complete Solutions $12.99   Add to cart

Exam (elaborations)

CSCI-0046 Systems Programming in Linux – MIDTERM Questions With Complete Solutions

 1 view  0 purchase
  • Course
  • LINUX
  • Institution
  • LINUX

CSCI-0046 Systems Programming in Linux – MIDTERM Questions With Complete Solutions

Preview 3 out of 20  pages

  • November 2, 2024
  • 20
  • 2024/2025
  • Exam (elaborations)
  • Unknown
  • LINUX
  • LINUX
avatar-seller
Classroom
CSCI-0046 Systems Programming in Linux – MIDTERM
Questions With Complete Solutions

! operator Correct Answer returns TRUE when condition is
FALSE and returns FALSE when condition is TRUE. So the
opposite of the condition.

// Jack wrote a function to increment the value of x. But he is
using a pointer as the parameter
// Which statement inside the function will do the job of
incrementing .
int func ( int *x )
{
// which is statement is valid ?

// statement 1 :
*x++ ;

// statement 2
* ( x++ ) ;

// statement 3
( *x ) ++ ;
}
main ( )
{
int x = 10 ;
func ( &x ) ;
printf ( " x = %d \n " x );

} Correct Answer statement 3

,&& (AND) Operator Correct Answer returns TRUE when
ALL the conditions under consideration are true and returns
FALSE when any ONE or MORE than one condition is false.

#include <stdio.h>
int main ( )
{
int x = 10;
switch x
{
case 10 :
printf ( "Yes" );
break ;
}

}

// The above code compiles fine. True or False Correct Answer
False- Yes, there should be ( ) around x in the switch statement

all data cells in this array will have a value of 4
int data [ 6 ] = { 4 } ; Correct Answer False

Cells in an array are contiguous Correct Answer True

char data [ 2 ] [ 3 ] = { { 2, 3 , 0} , { 1 , 4, 5 } } ;
int i ;
for ( i = 0 ; i < 3 ; i++ )printf ( "%d ", data [ 1 ] [ i ] );

The above code would print Correct Answer 1 4 5

, How to declare an array-1D? Correct Answer dataType
arrayName[arraySize];

How to define a pointer variable? Correct Answer int *ptr ;

ptr is now a pointer variable

if ( -10 )
printf ( "Yes \n" );
else
printf ( "No\n");

The above statement would print Yes.
True or False Correct Answer True

if ( 0 )
printf ( "Yes \n" );
else
printf ( "No\n");

The above statement would print Yes.
True or False Correct Answer False

int * ptr = 20 ;
int y = *ptr ;
The above statement WILL give you run-time error
TRUE OR FALSE Correct Answer True - Yes,
ptr = 20 is illegal because you are assigning 20 (a address
somewhere in the kernel ) to ptr. When you access the value

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 Classroom. Stuvia facilitates payment to the seller.

Will I be stuck with a subscription?

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

Can Stuvia be trusted?

4.6 stars on Google & Trustpilot (+1000 reviews)

80364 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
$12.99
  • (0)
  Add to cart