#include<stdio.h>
#include<conio.h>
void main()
{
int a,b,c;
int menu;
printf("choose the arithmetic option\n");
scanf("%d",&menu);
switch(menu)
{
case 1:
printf("Enter The Two Numbers:\n");
scanf("%d%d",&a,&b);
c=a+b;
printf("The addition of two numbers %d\n",c);
break;
case 2:
printf("Enter THE TWO NUMBERS:\n");
scanf("%d%d",&a,&b);
c=a-b;
printf("The subtraction of two numbers %d\n",c);
break;
case 3:
printf("Enter THE TWO NUMBERS:\n");
scanf("%d%d",&a,&b);
c=a*b;
printf("The multiplication of two numbers %d\n",c);
break;
case 4:
printf("Enter THE TWO NUMBERS:\n");
scanf("%d%d",&a,&b);
c=a/b;
printf("The division of two numbers %d\n",c);
break;
}
getch();
}
The answer depends on what the explicit rule is!
It depends on the language. Each has different operators. First thing you learn with any language is which ones they use. some common operators include: i != 5 i <> 5
write an assembly language program to find sum of N numbers
You don't write an algorithm for a C++ program, unless you are documenting the C++ program after-the-fact. The normal procedure is to write the algorithm first, in a language independent fashion, and then translate that stated algorithm into C++ code, or into whatever language you wish.
write it in 8085
switch(ch) { case '+': ....cout <<"arithmetic operator"; ....break; //<===break is a must /// <====================other cases . . default: // <=======else }
Write a program in C for showing working of different logical operator in C.Your program should guide users with proper message/menu on the console. (5 Marks)
There is no simple answer because there is no simple rule for primes: it is certainly NOT an arithmetic progression.
With a text mode text editor. Or simply switch it on if the OS supports X windows.
R = (A > B && A > C) ? A : (B > C) ? B : C; // parentheses not necessary - for clarity only
This question cannot be generally answered, the output depends on the actual program.
#includemain(){int i,j; /*int type variables*/scanf("%d",i);/*read i value*/j=i&1; /*perform logical and operation to find 1at lsbif(j==0)printf("even");elseprintf("odd");getch();}One more example found at "c programming"web: cprogramming-bd.com/c_page4.aspx#ODD%20Numbers
It depends upon which language you intend to write your script, however 5 digit numbers are simply numeric value and any scripting language that supports basic arithmetic operators will be able to achieve this easily. The hardest part is converting the user input (which is typically a character sequence) into an actual number, however most scripting languages will provide some means of converting strings to numeric values.
There are many different operators, which are you referring to?
a = b = c
// a complete C program without using any operators int main() { return 0; } // a non-useless program, which accepts a single command line argument and // prints whether or not the first character is a vowel int main(int argc, char** argv) { if(argc != 2) { return 1; } switch(argv[1][0]) { case 'a': case 'e': case 'i': case 'o': case 'u': printf("vowel\n"); break; default: printf("not vowel\n"); } return 0; }
How to write a program for secant method by mathematica