String str = "Hellow";System.out.println(str.indexOf('t));
public class CheckPositiveOrNegativeExample1{public static void main(String[] args){//number to be checkint num=912;//checks the number is greater than 0 or notif(num>0){System.out.println("The number is positive.");}//checks the number is less than 0 or notelse if(num<0){System.out.println("The number is negative.");}//executes when the above two conditions return falseelse{System.out.println("The number is zero.");}}}
#include<stdio.h>#include<stdlib.h>int main(){int a[10],n,i;system ("cls");printf("Enter the number to convert: ");scanf("%d",&n);for(i=0;n>0;i++){a[i]=n%2;n=n/2;}printf("\nBinary of Given Number is=");for(i=i-1;i>=0;i--){printf("%d",a[i]);}return 0;}