23.12.19

Type cating example program in c

#include<stdio.h>
#include<conio.h>
void main()
{
int a,b;
float c;
clrscr();

printf("Enter two numbers");
scanf("%d%d",&a,&b);

c=(float)a/b;

printf("Quotient=%f",c);

}

 OUTPUT:

Enter two numbers 5
2
Quotient is 2.5

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...