C Programming - If Else condition - Session - 10 - AEIOU
The following is the chat and other information exchanged during the session-10:
Thameem8:43 PM
5)
#include <stdio.h>
void main ()
{
int number;
printf("Enter the number ");
scanf("%d",&number);
if (number >=0)
{
printf("you entered %d, and it is a Positive.",number);
}
else
{
printf("you entered %d, and it is a Negative.",number);
}
}
Jameela a8:43 PM
My Mike is not working
Jameela a8:51 PM
Understood
Thameem8:56 PM
#include <stdio.h>
void main ()
{
int number1;
int number2;
printf("enter the number1 ");
scanf("%d",&number1);
printf("enter the number2 ");
scanf("%d",&number2);
printf("Sum = %d.",number1+number2);
}
#include <stdio.h>
void main ()
{
int number1;
int number2;
printf("enter the number1 ");
scanf("%d",&number1);
printf("enter the number2 ");
scanf("%d",&number2);
printf("Sum = %d.\n",number1+number2);
printf("Difference = %d.\n",number1-number2);
printf("Product = %d.\n",number1*number2);
printf("Quotient = %d.\n",number1/number2);
printf("Modulus = %d.\n",number1%number2);
}
Jameela a8:59 PM
Yes
Jameela a9:01 PM
Okay
siva prakash9:01 PM
A E I O U
Thameem9:14 PM
#include <stdio.h>
void main ()
{
char letter;
printf("Enter the letter ");
scanf("%c",&letter);
if (letter == 'a'||'e'||'i'||'o'||'u' && 'A'||'E'||'I'||'O'||'U')
printf("you entered %c, and it is a vowel",letter);
else if ((letter <= 'a' && letter >= 'z') || (letter <= 'A' && letter >= 'Z'))
{
printf("you entered %c, and it is not a vowel.",letter);
}
// else
// {
// printf("you entered %c, and it is a not a vowel.",letter);
// }
}
Jameela a9:30 PM
Okay
waq-ujqn-gks
No comments:
Post a Comment