Posts

Showing posts from October, 2021

JAVA Basics

 package com.codewithharry; import java.util.Scanner; public class Main {     static int sum(int a, int b){         return a+b;     }     public static void main(String[] args) { // Write your code here //        System.out.println("Hello World");      /* Variables      Just Like:         -Water - Bucket         -Masala - box         -Lunch - LunchBox      In Java:      Variables are containers which store data values      String, int, float, char, boolean      How to declare variables:      syntax - <dataType> <variableName> = <value>;       */      String name = "Harry";      String channel = "CodeWithHarry"; //     System.out.println(name); //     System...

C Basics

1:--  #include <stdio.h> int main(){     printf("Hello World\n");     return 0; }   2:-- #include <stdio.h> int main() {     // Single line comments: compiler will ignore this     /*     this is a multi     line      comment     */     // int, float, char     int a1 = 7;                 // 2 to 4 bytes     unsigned short integer = 8; // 2 bytes     long integer1 = 8;          // 4 bytes     short integer2 = 8;         // 2 bytes     float b1 = 8.0;                    // 4 bytes - 6 decimal precision     double myfloat1 = 7.45;            // 8 bytes - 15 decimal places precision     long double myfloat2 = 7.43453455; // 10 bytes - 1...