This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.sql.*; | |
public class ConnectionDemo { | |
public static void main(String[] arg){ | |
//Declaring the variables | |
Connection con = null; | |
Statement stm = null; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<stdio.h> | |
/* do while loop and break statement used to | |
count the number of character in the string */ | |
int main(){ | |
char str[]="Grettings"; | |
int count=0; | |
do{ | |
if(str[count]=='\0'){ | |
printf("There are %d characters in total\n",count); | |
break; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<iostream> | |
using namespace std; | |
int sortArray(int[],int); | |
int main(){ | |
int mark[]={9,3,5,6,1,5,4,7,1}; | |
int size=sizeof(mark)/sizeof(int); | |
sortArray(mark,size); | |
return 0; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<iostream> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def binarySearch(data,search): | |
while len(data) > 1: | |
mid=len(data)//2 | |
if data[mid] is search: | |
return True | |
elif data[mid] > search: | |
return binarySearch(data[:mid],search) | |
else: | |
return binarySearch(data[mid:],search) | |
if len(data) is 1: |