• ¿Documento equivocado? Cámbialo gratis
  • Escrito por estudiantes que aprobaron
  • Inmediatamente disponible después del pago
  • Leer en línea o como PDF
Vender
¿Dónde estudias?
Tu idioma
Document preview thumbnail
Vista previa 3 fuera de 20 páginas
Examen

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

Document preview thumbnail
Vista previa 3 fuera de 20 páginas

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

Vista previa del contenido

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

Información del documento

Subido en
2 de noviembre de 2024
Número de páginas
20
Escrito en
2024/2025
Tipo
Examen
Contiene
Desconocido
$13.49

¿Documento equivocado? Cámbialo gratis Dentro de los 14 días posteriores a la compra y antes de descargarlo, puedes elegir otro documento. Puedes gastar el importe de nuevo.
Escrito por estudiantes que aprobaron
Inmediatamente disponible después del pago
Leer en línea o como PDF

Seller avatar
Los indicadores de reputación están sujetos a la cantidad de artículos vendidos por una tarifa y las reseñas que ha recibido por esos documentos. Hay tres niveles: Bronce, Plata y Oro. Cuanto mayor reputación, más podrás confiar en la calidad del trabajo del vendedor.
Classroom
4.0
(1213)
Vendido
5013
Seguidores
3246
Artículos
56710
Última venta
2 días hace



Por qué los estudiantes eligen Stuvia

Creado por compañeros estudiantes, verificado por reseñas

Calidad en la que puedes confiar: escrito por estudiantes que aprobaron y evaluado por otros que han usado estos resúmenes.

¿No estás satisfecho? Elige otro documento

¡No te preocupes! Puedes elegir directamente otro documento que se ajuste mejor a lo que buscas.

Paga como quieras, empieza a estudiar al instante

Sin suscripción, sin compromisos. Paga como estés acostumbrado con tarjeta de crédito y descarga tu documento PDF inmediatamente.

Student with book image

“Comprado, descargado y aprobado. Así de fácil puede ser.”

Alisha Student

Preguntas frecuentes