#include<stdio.h> int main() { int num1,num2,num3; printf("\nEnter value of num1,num2,num3:"); scanf("%d %d %d", &num1, &num2 ,&num3); if((num1>num2)&&(num1>num3)){ printf("The greatest number is num1\n"); } else if((num2>num3)&&(num2>num1)){ printf("The greatest number is num2\n"); }else{ printf("The greatest number is num3\n"); } return 0; } after that when you run this code into your Vs code terminal, you have to give some input to your program then press "Enter" and you will see the output in your terminal.
#include<stdio.h> int main(int argc, char *argv[]) { int a, b; printf("Enter number a\n"); scanf("%d", &a); printf("Enter number b\n"); scanf("%d", &b); printf("The sum is %d\n", a+b); return 0; } Now give two integers as user input and press "Enter" and check the results. If you have any doubt comment down below.
You are required to compute the power of a number by implementing a calculator. Create a class MyCalculator which consists of a single method long power(int, int) . This method takes two integers, and , as parameters and finds . If either or is negative, then the method must throw an exception which says " ". Also, if both and are zero, then the method must throw an exception which says " " For example, -4 and -5 would result in . Complete the function power in class MyCalculator and return the appropriate result after the power operation or an appropriate exception as detailed above. Input Format Each line of the input contains two integers, and . The locked stub code in the editor reads the input and sends the values to the method as parameters. Constraints Output Format Each line of the output contains the result...
Comments
Post a Comment