Beecrowd 1073 Even Square Problems Solution

Beecrowd 1073 Even Square Problems Solution in C++, C, and Python Even Square Read an integer N. Print the square of each one of the even values from 1 to N including N if it is the case. Input The input contains an integer N (5 < N < 2000). Output Print the square of each one of the even values from 1 to N, … Read more

Beecrowd 1071 Sum of Consecutive Odd Numbers I Solution || Beecrowd 1071

Beecrowd 1071

Beecrowd 1071 Sum of Consecutive Odd Numbers I Solution Introduction The URI 1071 problem requires finding the sum of all the odd numbers between two input values. This is a common problem in programming, and it is often used to test a programmer’s skills in loop constructs, conditional statements, and basic arithmetic operations. In this … Read more

Beecrowd 1175 – Array change I Solution

Beecrowd 1175 – Array change I Solution Array change I URI 1175 Array change I Problem: Write a program that reads an array N [20]. After, change the first element by the last, the second element by the penultimate, etc., until changing the 10th to the 11th. Print the modified array. Input: The input contains … Read more

Codeforces734A Anton and Danik solution

Codeforces734A Anton and Danik solution

Codeforces734A Anton and Danik solution in Cpp Question link Codeforces734A Anton and Danik solution. Anton likes to play chess, and so does his friend Danik. Once they have played n games in a row. For each game, it’s known who was the winner — Anton or Danik. None of the games ended with a tie. Now Anton wonders, … Read more

Codeforces 110A Nearly Lucky Number Solution in CPP

Codeforces 110A Nearly Lucky Number Solution

Question link: Codeforces 110A Nearly Lucky Number solution in CPP #include<bits/stdc++.h> using namespace std; int main() { string a; int c=0,z=0; cin>>a; for(int i=0;i<a.size();i++) { if(a[i]==’4’||a[i]==’7′)//Codeforces 110A Nearly Lucky Number solution in CPP c++; } if(c==4||c==7) cout<<“YES”<<endl; else cout<<“NO”<<endl; } Codeforces 734A.Anton and Danik solution in Cpp

Codeforces 59AWord Solution in C/CPP

Codeforces 59AWord Solution

Codeforces 59AWord Solution question Codeforces 59AWord Solution in CPP #include<iostream> #include<string> #include<algorithm> using namespace std; int main() { string a; int l=0,u=0; cin>>a; for(int i=0;i<a.size();i++) { if(a[i]>=’a’&& a[i]<=’z’) { l++; } else u++; } if(l>=u){ for(int i=0;i<a.size();i++)//Codeforces 59A.Word Solution a[i]=tolower(a[i]); cout<<a<<endl; } else { for(int i=0;i<a.size();i++) { a[i]=toupper(a[i]); } cout<<a<<endl; } } Codeforces 59AWord Solution … Read more

Elephant Codeforces || Codeforces 617A Elephant solution in C++

Elephant Codeforces

Codeforces Elephant Question Elephant Codeforces solution in C++ An elephant decided to visit his friend. It turned out that the elephant’s house is located at point 0 and his friend’s house is located at point x(x > 0) of the coordinate line. In one step the elephant can move 1, 2, 3, 4 or 5 positions forward. Determine, what is the minimum number of steps he need to … Read more

Codeforces 546A Soldier and Bananas solution in C++

Codeforces 546A Soldier and Bananas solution in C++

Codeforces 546A. Soldier and Bananas Question A. Soldier and Bananas A soldier wants to buy w bananas in the shop. He has to pay k dollars for the first banana, 2k dollars for the second one and so on (in other words, he has to pay i·k dollars for the i-th banana). He has n dollars. How many dollars does he have to borrow from his … Read more

Array Addition using 2d array in C || Add Two Matrices Using Multi-dimensional Arrays in C

2d array in C

Array Addition using 2d array in C #include<stdio.h> void main() { int i,j; int a[3][4],b[3][4],c[3][4]; for(i=0;i<3;i++){ for(j=0;j<4;j++){ printf(“a[%d][%d]”,i,j); scanf(“%d”,&a[i][j]); } } for(i=0;i<3;i++){ for(j=0;j<4;j++){ printf(“%d “,a[i][j]); } printf(“\n”); } for(i=0;i<3;i++){ for(j=0;j<4;j++){ printf(“b[%d][%d]”,i,j); scanf(“%d”,&b[i][j]); } } for(i=0;i<3;i++){ for(j=0;j<4;j++){ printf(“%d “,b[i][j]); } printf(“\n”); } printf(“\n”); printf(“sum of two array is :\n”); for(i=0;i<3;i++){ for(j=0;j<4;j++){ c[i][j]=a[i][j]+b[i][j]; } } for(i=0;i<3;i++){ for(j=0;j<4;j++){ … Read more

2D Arrays in C || C Multidimensional Arrays

2D Arrays in C

Understanding 2D Arrays in C Multidimensional arrays in C are those that have more than one dimension. They can be compared to a table with columns and rows. In C, a multidimensional array can be declared using the following syntax: data_type array_name[row_size][column_size]; For instance, we may write the following to declare a 2D array with … Read more