1 2 3 4 5 6 7 8 9 10 11 12 13 14 /* Write a program that will read a float type value from the keyboard and print the following output. ->Small Integer not less than the number. ->Given Number. ->Largest Integer not greater than the number. */ class ValueFormat{ public static void [...]
1 2 3 4 5 6 7 8 9 10 class Minof2{ public static void main(String args[]){ //taking value as command line argument. //Converting String format to Integer value int i = Integer.parseInt(args[0]); int j = Integer.parseInt(args[1]); int result = (i<j)?i:j; System.out.println(result+" is a minimum value"); } }
1 2 3 4 5 6 7 8 9 10 11 12 class Maxof2{ public static void main(String args[]){ //taking value as command line argument. //Converting String format to Integer value int i = Integer.parseInt(args[0]); int j = Integer.parseInt(args[1]); if(i > j) System.out.println(i+" is greater than "+j); else System.out.println(j+" is greater than "+i); } }
C program for Macro Processor #include<stdio.h> #include<conio.h> #define getx1y1 printf("Enter the order of Ist Matrix:"); scanf("%d%d",&x1,&y1); #define getx2y2 printf("Enter the order of IIst Matrix:"); scanf("%d%d",&x2,&y2); #define inputa printf("Enter the value of a:"); for(i=0;i<x1;i++) for(j=0;j<y1;j++) scanf("%d",&a[i][j]); #define inputb printf("Enter the value of b:"); for(i=0;i<x2;i++) for(j=0;j<y2;j++) scanf("%d",&b[i][j]); #define addab for(i=0;i<x1;i++) { for(j=0;j<y1;j++) { [...]
This is the one stop educational site for all Electronic and Computer students. If you want to learn something new then we are here to help. We work on Microcontroller projects, Basic Electronics, Digital electronics, Computer projects and also in basic c/c++ programs.
#Home #Sitemap #Resources #Terms of Use
Copyright©2012 electrofriends.com All Rights Reserved
Contact:info@electrofriends.com