diff --git a/New Text Document.c.txt b/New Text Document.c.txt new file mode 100644 index 0000000..2e720b3 --- /dev/null +++ b/New Text Document.c.txt @@ -0,0 +1,8 @@ +#include +int main() +{ + int m,n; + scanf("%d %d",&m,&n); + printf("%d",m+n); +return0; +} \ No newline at end of file diff --git a/circular array rotation.c b/circular array rotation.c new file mode 100644 index 0000000..873dbb2 --- /dev/null +++ b/circular array rotation.c @@ -0,0 +1,21 @@ +#include +#include + + +int main() { + int n, k, q; + scanf("%d", &n); + scanf("%d", &k); + scanf("%d", &q) + int data[n]; + for(int i=0; i +#include +#include +#include +#include +#include +#include +int days = 215; //256th days will be in 9th month so in 8 months, feb has variable days so + //remaining 7 months days will be 215 +void solve(int year){ + int febdays; + if(year<=1917) //julian calender + if(year%4 == 0) + febdays=29; + else + febdays=28; + else if(year == 1918) + febdays=15; + else + { + if((year%400 == 0)|| (year%4 == 0)&&(year%100 !=0)) + febdays=29; + else + febdays=28; + } + printf("%d.09.%d",256-(febdays+days),year);//febdays+days will be 8 months days +} + +int main() { + int year; + scanf("%d", &year); + int result_size; + solve(year); + return 0; +} diff --git a/max array.c b/max array.c new file mode 100644 index 0000000..31ceff5 --- /dev/null +++ b/max array.c @@ -0,0 +1,11 @@ +#include +int largest(int arr[], int n) +{ + int i; + int max = arr[0]; + for (i = 1; i < n; i++) + if (arr[i] > max) + max = arr[i]; + + return max; +} diff --git a/ssq.c b/ssq.c new file mode 100644 index 0000000..486b216 --- /dev/null +++ b/ssq.c @@ -0,0 +1,18 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include + +int main() +{ + int a,b; + scanf("%d",&a); + scanf("%d",&b); + int k=(floor(sqrt(b))-ceil(sqrt(a))+1); + printf("%d\n",k);// k is the number of perfect squares between number a and b +}