Professional Documents
Culture Documents
Document
Document
#include <stdio.h>
Int main() {
Int numItems = 5;
Return 0;
Ans 2:
#include <stdio.h>
Int main() {
Unsigned numPets = 2;
Return 0;
Ans 3:
#include <stdio.h>
Int main() {
// Declare variables
Scanf(“%d”, &originalNumber);
// Store the original number in a temporary variable
Temp = originalNumber;
While (temp != 0) {
temp /= 10;
If (originalNumber == reversedNumber) {
} else {
Return 0;
Ans 4:
#include <stdio.h>
Int main() {
// Declare variables
Scanf(“%f”, &angle2);
Scanf(“%f”, &angle3);
} else {
Printf(“The triangle is not valid. The sum of angles should be 180 degrees.\n”);
Return 0;
Ans 5:
#include <stdio.h>
Int main() {
// Declare variable
Char character;
// Input a character
} else {
Return 0;
Switch (character) {
Case ‘a’:
Case ‘e’:
Case ‘I’:
Case ‘o’:
Case ‘u’:
Printf(“It is a vowel.\n”);
Break;
Default:
Printf(“It is a consonant.\n”);
Return 0;
Ans 6:
#include <stdio.h>
Int main() {
Int numSmallTriangles = 3;
Printf(“The perimeter of the large equilateral triangle is: %.2f inches\n”, perimeter);
Return 0;