Ifelse Assignment
Ifelse Assignment
h>
int main()
{
int a;
printf("enter the value of a ");
scanf("%d",&a);
if(a>10){
printf("number is greater than 10");
}
return 0;
}
2. #include <stdio.h>
int main()
{
int a;
printf("enter the value of a ");
scanf("%d",&a);
if(a>10){
printf("number is greater than 50");
}
return 0;
}
3. #include <stdio.h>
int main()
{
int a;
printf("enter the value of a ");
scanf("%d",&a);
if(a>10){
printf("number is greater than 87");
}
return 0;
}
4. int main()
{
int a;
printf("enter the value of a ");
scanf("%d",&a);
if(a==1){
printf("one");
}
else{
printf("your input is not valid ");
}
return 0;
}
6.#include <stdio.h>
int main()
{
char a;
printf("enter the character");
scanf("%c",&a);
if(a=='a'){
printf("apple");
}
else{
printf("your input is not valid ");
}
return 0;
}
7.#include <stdio.h>
int main()
{
char a;
printf("enter the character");
scanf("%c",&a);
if(d=='d'){
printf("drum");
}
else{
printf("your input is not valid ");
}
return 0;
}
8.#include <stdio.h>
int main()
{
int num;
printf("enter the value of num");
scanf("%d",&num);
if(num%2==0){
printf("even");
}
else{
printf("odd");
}
return 0;
}
9. #include <stdio.h>
int main() {
int num;
printf("Enter a number: ");
scanf("%d", &num);
if (num % 5 == 0) {
printf("%d is divisible by 5.\n", num);
} else {
printf("%d is not divisible by 5.\n", num);
}
return 0;
}
int main() {
int num;
printf("Enter a number: ");
scanf("%d", &num);
if (num % 10 == 0) {
printf("%d is divisible by 10.\n", num);
} else {
printf("%d is not divisible by 10.\n", num);
}
return 0;
}
int main() {
int num1, num2, sum;
printf("Enter the first number: ");
scanf("%d", &num1);
printf("Enter the second number: ");
scanf("%d", &num2);
sum = num1 + num2;
printf("The sum of %d and %d is %d.\n", num1, num2, sum);
return 0;
}
int main() {
int num1, num2, sub;
printf("Enter the first number: ");
scanf("%d", &num1);
printf("Enter the second number: ");
scanf("%d", &num2);
sub = num1- num2;
printf("The sub of %d and %d is %d.\n", num1, num2, sub);
return 0;
}
13.
#include <stdio.h>
int main() {
int num1, num2, sub;
printf("Enter the first number: ");
scanf("%d", &num1);
printf("Enter the second number: ");
scanf("%d", &num2);
sub = num1- num2;
printf("The sub of %d and %d is %d.\n", num1, num2, sub);
return 0;
}
int main() {
int num1, num2, product;
return 0;
}
int main() {
int num1, num2, remainder;
return 0;
}
int main() {
int num1, num2, ;
return 0;
}
17. #include<stdio.h>
int main()
{
int num1,num2,div;
printf("Enter First Number : ");
scanf("%d", &num1);
printf("\nEnter Second Number : ");
scanf("%d",&num2);
div=num1/num2;
printf("\nDivision of %d & %d is = %d",num1,num2,div);
return 0;
}
#include <stdio.h>
int main() {
int age;
return 0;
}
int main() {
char character;
return 0;
}
19.#include <stdio.h>
#include <ctype.h>
int main() {
char character;
return 0;
}