Cycle 3
Cycle 3
1. Write a C program to check whether the given character is vowel or not using switch case
2. Write a C program to print the grade of student based on the 6 subjects marks using switch
case.
3. Write a C program to find the sum and average of +ve numbers using goto statement.
4. Write a menu driven program to perform simple calculator.
5. Write a C program to find whether the given number is prime or not using break statement.
6. Write a C program to find the square root of ‘n’ positive numbers using continue statement
7. Write a C program to print the multiples of given number below 50 using continue statement
8. Write a C program to find the reverse of a given number
#include <stdio.h>
int main() {
while (n != 0) {
remainder = n % 10;
reverse = reverse * 10 + remainder;
n /= 10;
}
return 0;
}
9. Write a C program to check whether the given number is palindrome or not.
#include <stdio.h>
int main() {
return 0;
}
10. Write a C program to convert given decimal number to binary number.
/* Program to convert decimal number to binary */
#include<stdio.h>
int main(){
int a[10],n,i;
#include <stdio.h>
#include <conio.h>
int main()
{
// declaration of variables
int num, binary_num, decimal_num = 0, base = 1, rem;
printf (" Enter a binary number with the combination of 0s and 1s \n");
scanf (" %d", &num); // accept the binary number (0s and 1s)
printf ( " The binary number is %d \t", binary_num); // print the binary number
printf (" \n The decimal number is %d \t", decimal_num); // print the decimal
getch();
}
14. Write a C program to generate the Fibonacci series upto ‘n’ terms.
15. Write a C program to check whether the given number is armstrong or not
16. Write a C program to check whether the given number is adam number or not
Adam number is a special type of number in which the square of the number is the
reverse of the square of the reverse of the number. In other words, if we take the square
of a number and the square of its reverse, the two results should be the same after
reversing the order of the digits.
For example, 12 is an Adam number because
square(12) = 144
square of its reverse (21) is 441,
which is the reverse of 144.