Actividad de Bienvenida. Programación II

jaorduz
1,000 views

Open Source Your Knowledge, Become a Contributor

Technology knowledge has to be shared and made accessible for free. Join the movement.

Create Content

LogoGCCyC

Contents

  1. Data type

  2. Code/Scripts

This sections contains some questions about fundamental concepts about programming.

Data type

a. Consider the type: int, float and...

What are the other types?

b. Choose the correct answer.

A script/program/code/source-file is ...

c. Some keywords

in C are...

c. Examples of escape secuences

in C are...

Code/Scripts

  1. Fix the next code to get the size of a.
#include<stdio.h>
int main(){
int a = 2;
b =sizeof(a);
printf("salida %i. El tamanio es: %i Bytes\n" a, b)
return 0;
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
  1. Repair the follow code to get the values and size of A and a.
#include <stdio.h>
int main(){
int A, a;
A = 2
a = 3;
printf("A=\n", A);
printf("a=%i\n", a);
return 0;
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
  1. Organize the code in the correct form:
#include <stdio.h>
return 0;
{
bool isEven = true;
int main()
if(p==2)
else{
printf("p=%i es Impar %i\n",p ,isEven);
{
printf("p=%i es Par %i\n",p ,isEven);
}
}
int p=3;
#include <stdbool.h>
puts("1 = true and 0 = false\n\n");
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
  1. Arrange the code in the correct form:
// Biblioteca
// Declaracion de la funcion
void func(void);
// Definicion de la funcion funcion principal
int main(){
while(count--) {
}
return 0;
func(); // llamar la funcion
static int count = 5; // variable global
}
// Definicion de la funcion
printf("i es %d y la cuenta es %d\n", i, count);
register int i = 5; //variable local register(static)
void func( void ) {
i++;
}
#include <stdio.h>
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Go Up

Open Source Your Knowledge: become a Contributor and help others learn. Create New Content