Horje
java code to c code converter online Code Example
java code to c code converter online
import java.util.HashSet;
import java.util.Scanner;

class SerenaFlowers{
    public static void main(String args[])
    {
         Scanner sc = new Scanner(System.in);
         int n = sc.nextInt(); 
         int k = sc.nextInt(); 
         sc.nextLine(); 
         int arr[] = new int[n]; 
         String a[] = sc.nextLine().split(" ");
         HashSet hs = new HashSet<>();
         for(int i =0 ; i < a.length ; i++)
         {
             arr[i] = Integer.parseInt(a[i]); 
             if(i<k)
                 hs.add(arr[i]);
         }
         System.out.println(hs.size());
    }
}
java code to c code converter online
 java.util.HashSet;
import java.util.Scanner;
java code to c code converter online
static int distinctSubString(string s)
java code to c code converter online
import java.util.HashSet;
import java.util.Scanner;

class SerenaFlowers{
    public static void main(String args[])
    {
         Scanner sc = new Scanner(System.in);
         int n = sc.nextInt(); 
         int k = sc.nextInt(); 
         sc.nextLine(); 
         int arr[] = new int[n]; 
         String a[] = sc.nextLine().split(" ");
         HashSet hs = new HashSet<>();
         for(int i =0 ; i < a.length ; i++)
         {
             arr[i] = Integer.parseInt(a[i]); 
             if(i<k)
                 hs.add(arr[i]);
         }
         System.out.println(hs.size());
    }
}
java code to c code converter online
import java.util.Scanner;
class CodeChef
{
  public static void(String args[])
  {
    Scanner s=new Scanner;
    int t=s.nextInt();
    for(int i=0;i<t;i++)
    {
      int a=s.nextInt();
      int b=s.nextInt();
      if(a!=0)
      {
        System.out.println(a*b)
      }
      else
      {
        System.out.println(a);
      }
    }
  }
}
java code to c code converter online
package com.javainterviewpoint;

import java.util.Scanner;

public class Pattern18
{
    public static void main(String[] args)
    {
        // Create a new Scanner object
        Scanner scanner = new Scanner(System.in);

        // Get the number of rows from the user
        System.out.println("Enter the number of rows to print the pattern ");

        int rows = scanner.nextInt();

        System.out.println("** Printing the pattern... **");

        for (int i = 1; i <= rows; i++)
        {
            for (int j = 1; j < i; j++)
            {
                System.out.print(" ");
            }

            for (int k = i; k <= rows; k++)
            {
                System.out.print(k + " ");
            }
            System.out.println();
        }
        for (int i = rows; i >= 1; i--)
        {
            for (int j = 1; j < i; j++)
            {
                System.out.print(" ");
            }

            for (int k = i; k <= rows; k++)
            {
                System.out.print(k + " ");
            }
            System.out.println();
        }

    }
}




C

Related
counting sort using malloc and size-t type c Code Example counting sort using malloc and size-t type c Code Example
Algorithm that flips sentences and numbers Code Example Algorithm that flips sentences and numbers Code Example
c program to find minimum of 5 numbers using conditional operator in c Code Example c program to find minimum of 5 numbers using conditional operator in c Code Example
PDO Crud Code Example PDO Crud Code Example
esp32 dhcp server Code Example esp32 dhcp server Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
9