Learn Basic C Programming Examples for beginner -2

C Programming Examples

C Programming Examples for Beginners  Section 1: Understanding the Basics of C Programming In this section, we will provide you with a comprehensive overview of the basics of C programming. We will cover topics such as data types, variables, and operators. We will also provide you with some sample code to help you get started … Read more

URI Beecrowd 1116 Dividing X by Y Solution

URI Beecrowd 1116 Dividing X by Y Solution

URI Beecrowd 1116 Dividing X by Y Solution In C++ URI BEECROWD Problems Solution In this article, we will be discussing the solution to a coding problem that involves dividing X by Y. We will be using the programming languages C, C++, and Python to provide you with a solution that is not only accurate … Read more

Beecrowd 1049 Animal Solution

Beecrowd 1049 Animal Solution Animal Introduction In this guide, we will be discussing the Beecrowd 1049 Animal problem and providing a detailed solution in C, C++, C++, and Python. Our goal is to help readers understand the problem, provide a clear and concise solution, and offer tips on how to improve their programming skills. URI(Beecrowd … 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

Sum of an array in c || Sum of array Elements in C

sum of an array in c

Sum of an array in c Example 1 #include <stdio.h> int main() { int arr[5] = {1, 2, 3, 4, 5}; // Declare and initialize an array of 5 integers int sum = 0; int i; // Calculate the sum of the elements in the array for (i = 0; i < 5; i++) { … Read more

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

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