answersLogoWhite

0

#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();

}

User Avatar

Wiki User

14y ago

What else can I help you with?

Related Questions

Write an equivalence of switch statement and if statement?

switch(ch) { case '+': ....cout &lt;&lt;"arithmetic operator"; ....break; //&lt;===break is a must /// &lt;====================other cases . . default: // &lt;=======else }


What are the basic operator of c write its symbols and meaning?

In C programming, the basic operators include: Arithmetic Operators: + (Addition) - (Subtraction) * (Multiplication) / (Division) % (Modulus) Relational Operators: == (Equal to) != (Not equal to) &gt; (Greater than) &lt; (Less than) &gt;= (Greater than or equal to) &lt;= (Less than or equal to) Logical Operators: &amp;&amp; (Logical AND) || (Logical OR) ! (Logical NOT) These operators are fundamental for performing operations, comparisons, and logical evaluations in C programs.


Write a program in C for arithmetic operations between two integers your program should guide users with proper message or menu on the console?

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)


How do you write a c program when desktop is off?

With a text mode text editor. Or simply switch it on if the OS supports X windows.


How you can write an account of prime numbers in arithmetic progressions?

There is no simple answer because there is no simple rule for primes: it is certainly NOT an arithmetic progression.


Write a c plus plus program to find the largest among three numbers using ternary operators?

R = (A &gt; B &amp;&amp; A &gt; C) ? A : (B &gt; C) ? B : C; // parentheses not necessary - for clarity only


What is output if we don't write break statement in switch-case in c sharp?

This question cannot be generally answered, the output depends on the actual program.


What is the shell script program for adding five digit numbers?

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.


Write aC program to find whether a given number is even or odd without using arithmetic operators?

#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


How can you use just basic to write a program?

You can use BASIC to write a program by leveraging its straightforward syntax and commands to perform tasks like input, output, and simple arithmetic operations. Start by defining your program with a clear structure, using commands like PRINT for output and INPUT for user interaction. Utilize loops and conditionals to control the flow of the program, and keep the code organized with comments for clarity. BASIC's simplicity makes it an excellent choice for beginners to grasp programming concepts effectively.


How to write C program without operater?

// 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 do you write a program to performs all airthematic operation between two matrixs using array?

To write a program that performs arithmetic operations between two matrices using arrays, first define two 2D arrays to represent the matrices. Then, create functions for each arithmetic operation (addition, subtraction, multiplication, etc.) that iterate through the elements of the matrices, performing the operation element-wise. Ensure to handle cases where the matrices have different dimensions, as this would affect the validity of the operations. Finally, print the result matrix after each operation.