This file contains 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> | |
int main() | |
{ | |
char str[100]; | |
int i=0,nl=0; | |
gets(str); // it takes input with space | |
while(str[i] !='\0') // null termination character, it marks the the end of string | |
{ | |
char ch= str[i]; |
This file contains 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> | |
int main() | |
{ | |
char str[100]; | |
int i=0,nl=0; | |
gets(str); // it takes input with space | |
while(str[i] !='\0') // null termination character, it marks the the end of string | |
{ | |
char ch= str[i]; |
This file contains 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
$myarray=array(βshohanβ,βDhakaβ,βcity universityβ,203,30.33,βSβ); // declar ed an array which contain flaot, character, integer, and string type value. |
This file contains 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
<?php | |
$city=array(βduβ=>βDhakaβ,βrajβ=>βRajshahiβ,βrangβ=>βRangpurβ) | |
echo $city[βduβ]; // print Dhaka | |
echo $city[0]; print Dhaka | |
?> |
This file contains 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> | |
int main() | |
{ | |
int i,n,x; | |
printf("Enter a positive number to check prime"); | |
scanf("%d",&n); | |
x = sqrt(n); | |
for(i=2;i<=x;i++) | |
{ | |
if(n%i==0) |
This file contains 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> | |
int main() | |
{ | |
int i,j; | |
int long long sum=0; | |
int const long long num=2000000; | |
for(i=1;i<=num;i++){ | |
for(j=2;j<i;j++){ | |
if(i%j==0) | |
break; |
This file contains 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> | |
main() | |
{ | |
long long int i,j,k,n=2000000,sum=2; | |
int count; | |
for(i=3;i<n;i++){ | |
count=1; // assume that it is prime | |
for(j=2;j<=sqrt(i);j++){ | |
if(i%j==0){ | |
count=0; // it is not prime |
This file contains 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> | |
int main() | |
{ | |
int i,j; | |
int long long sum=0; | |
int const long long num=2000000; | |
for(i=1;i<=num;i++){ | |
for(j=2;j<i;j++){ | |
if(i%j==0) | |
break; |
This file contains 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> | |
main() | |
{ | |
long long int i,j,k,n=2000000,sum=2; | |
int count; | |
for(i=3;i<n;i++){ | |
count=1; // assume that it is prime | |
for(j=2;j<=sqrt(i);j++){ | |
if(i%j==0){ | |
count=0; // it is not prime |
This file contains 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> // solved by Md. shohanur Rahaman | |
int main() | |
{ | |
int a,b,c,result; | |
int n,m; | |
for(n=2; ;n++){ | |
for(m=1;m<n;m++){ | |
a=(n*n)-(m*m); | |
b=2*n*m; |