23.12.19

arthmetic operations(accepting value from user) program in c

#include<stdio.h>
#include<conio.h>
main()
{
int a,b;
clrscr();
scanf("%d%d",&a,&b);
printf("enter a value");
printf("enter b value");
printf("\n Add is %d",a+b);
printf("\n Sub is %d",a-b);
printf("\n Mul is %d",a*b);
printf("\n Div is %d",a/b);
printf("\n Remainder is %d",a%b);
getch();
}



OUTPUT:
enter a value 10
enter b value 10
Add is 20
Sub is 0
Mul is 100
Div is 1
Remainder is 0


No comments:

Post a Comment

JAVA program pattern 2

import java.util.Scanner; public class pattern3 { public static void main(String args[]) { int i,j; Scanner sc=new Scanner(System.in); Syste...