Computer 10
Computer 10
Operation Mode
Write/Storage Output
Add Append
Syntax for read and write data
Store/Write Display/Retrieve/read/access
Print A; 3 21 34 1 2 4 4<=5(T) 21
A=A+B
B=A+B 4 55 89 1 2 5 5<=5(T) 55
#include<stdio.h>
void main()
{
int a,b,sum=0;
printf("Enter any two numbers:\n");
scanf("%d%d",&a,&b);
sum = a+b;
printf("Sum of two number is %d",sum);
getch();
}
Program to check input character is vowel or consonant
#include <stdio.h>
int main() {
char ch;
// Prompt the user to enter a character
printf("Enter a character: ");
scanf("%c", &ch);
if (ch == 'a' || ch == 'e' || ch == 'i' || ch == 'o' || ch == 'u')
printf("%c is a vowel.\n", ch);
else if (ch == 'A' || ch == 'E' || ch == 'I' || ch == 'O' || ch == 'U')
printf("%c is a vowel.\n", ch);
else if ((ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z'))
printf("%c is a consonant.\n", ch);
else
printf("%c is not an alphabet.\n", ch);
return 0;