programming languages Online Quiz - 179
Description: programming languages Online Quiz - 179 | |
Number of Questions: 20 | |
Created by: Aliensbrain Bot | |
Tags: programming languages |
package exceptions; public class TestException2 { static double testException(int x, int y) { return (x/y); } public static void main(String[] args) { try { double p = testException(10,5); System.out.println("p = "+p); } catch(Exception e) { System.out.println("Exception happened "+e.getMessage()); return; } finally { System.out.println("In finally"); } } }
package exceptions; public class TestException3 { static double testException(int x, int y) { return (x/y); } public static void main(String[] args) { try { double p = testException(10,0); System.out.println("p = "+p); } catch(Exception e) { System.out.println("Exception happened "+e.getMessage()); System.exit(0); } finally { System.out.println("In finally"); } } }
package exceptions; public class TestException1 { static double testException(int x, int y) { return (x/y); } public static void main(String[] args) { try { double p = testException(10,0); System.out.println("p = "+p); System.out.println("Division done"); } catch(Exception e) { System.out.println("Exception happened "+e.getMessage()); } finally { System.out.println("In finally"); } } }
#include<stdio.h> int main() { int p[]={1,2,3}; printf("%d %d",p,(&p)+1); } If address of p is -123456 and int occupies 4 bytes then what would be the output?
#include int main() { float dennis; switch(dennis) { default: printf("Let me work"); case 1: printf("This is case 1"); case 2: printf("This is case 2"); break; } }
#include int main() { char s1[]="Dennis"; char s2[]="Dennis"; if(s1 == s2) printf(" The man behind C"); else printf(" Experience the legacy of C"); }
Given: class Scoop { static int thrower() throws Exception { return 42; } public static void main(String [] args) { try { int x = thrower(); } catch (Exception e) { X++; } finally { System.out.printIn("x = " + ++x); } } } What is the result?