Font size
WorksheetsQuiz 1 - Intro to C
Total questions: 10
Worksheet time: 18mins
Declare an integer variable named num.
float num;
int num;
char num;
double num;
Initialize the variable num to 0.
num == 0;
0
num = 0;
int num = 0;
Read and store the value entered by user to num.
scanf (“%i”, &num);
scanf ("%f", &num);
"%i", #
scanf ("%i", num);
4.Multiply the current value of num into 2 and assign the new value to num.
num =+ 2;
num = num * num;
num = 2 * 2;
num = num * 2;
5.Display the value of num.
printf (The value of num is: num);
printf ("The value of num is: %i,);
printf ("The value of num is:%i, num);
printf ("The value of num is: %i, &num);
Declare a floating points number named val.
Initialize the variable val to 1.
Read and store the value entered by user to val
Multiply the current value of val into 2 and assign the new value to val.
Display the value of val with 3 decimal points
