Looking for ICT1.002 BASIC PROGRAMMING (2025 - 2026) test answers and solutions? Browse our comprehensive collection of verified answers for ICT1.002 BASIC PROGRAMMING (2025 - 2026) at moodle.usthlearningsupport.vn.
Get instant access to accurate answers and detailed explanations for your course questions. Our community-driven platform helps students succeed!
In the "Optimized" Bubble Sort, what is the purpose of the swapped flag?
#include <stdio.h>
#include <math.h>
int main() {
int x = 16;
double y;
y = sqrt(x) + log10(100) - pow(2, 2);
printf("%.0f\n", y);
return 0;
}
!Before calling a function from a standard library in C, which directive should be used?
!Why is "rb" important on Windows for binary files?
What is the output of this program?
char s[] = "mississippi";
int cnt = 0;
for(int i = 0; s[i]; i++)
if(s[i] == 's' && i % 2 == 0) cnt++;
printf("%d", cnt);
!What is the output of this program?
int a[] = {1, 2, 3};
int cnt = 0;
for(int i = 0; i < 3; i++)
for(int j = i+1; j < 3; j++)
if(a[i] + a[j] > 3) cnt++;
printf("%d", cnt);
!
#include <stdio.h>
void print(int n)
{
if (n == 0)
return;
printf("%d ", n);
print(n - 1);
}
int main()
{
print(4);
return 0;
}
!What will be printed by the following code?
void printList() {
struct node *p = head;
while (p != NULL) {
printf("%d ", p->data);
p = p->next;
}
}
If head == NULL, the output is:
What happens if you read past EOF using fgetc()?
What is the primary purpose of a temporary variable (often called temp) when swapping two variables A and B?
!