// Normal program
#include<stdio.h>
#include<conio.h>
void main()
{
int a=40,b=2;
printf("Result: =%d",a/b);
getch();
}
output:-20
//Ask numbers from user to divide
#include<stdio.h>
#include<conio.h>
void main()
{
int a,b;
float c;
printf("\n Enter Number: ");
scanf("%d %d",&a,&b);
c=a/b;
printf("Result: =%f",c);
getch();
}
No comments:
Post a Comment