0% found this document useful (0 votes)
1 views

Lesson 2 Codechump

The document contains three separate C programs. The first program prints the first five even numbers starting from 2, the second program displays a rainbow arch, and the third program prints a pattern representing the word 'CODE'. Each program includes comments explaining its functionality.
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
1 views

Lesson 2 Codechump

The document contains three separate C programs. The first program prints the first five even numbers starting from 2, the second program displays a rainbow arch, and the third program prints a pattern representing the word 'CODE'. Each program includes comments explaining its functionality.
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

#include <stdio.

h>

int main() {
// Print the first 5 even numbers starting from 2
for (int i = 2; i <= 10; i += 2) {
printf("%d\n", i); // Print each number on a new line
}
return 0; // Return 0 to indicate successful execution
}

Even parade numbers

#include <stdio.h>

int main() {
// Print the rainbow arch
printf(" Green\n");
printf(" Yellow Brown\n");
printf(" Orange Indigo\n");
printf(" Red Violet\n");

return 0;
}

Rainbow arch

#include <stdio.h>

int main() {
// Print the pattern for "CODE"
printf("CCCCC OOOOO DDDDD EEEEE\n");
printf("C O O D D E\n");
printf("C O O D D EEEE\n");
printf("C O O D D E\n");
printf("CCCCC OOOOO DDDDD EEEEE\n");

return 0;
}

You might also like