HAPPY ETHIOPIAN CHRISTMASS FOR ALLππ²π²ππ
https://t.me/+txk6Ik_UwGc4ZGM0
https://t.me/+txk6Ik_UwGc4ZGM0
https://t.me/+txk6Ik_UwGc4ZGM0
https://t.me/+txk6Ik_UwGc4ZGM0
π1π₯1
π6β€1π1
EvoNext
#TRY_ON_YOUR IDE C++ code that calculate addition of matrix transpose and multiplication #include <iostream> using namespace std; void multi(int arr[3][4],int arr2[4][3]); void add(int mat[3][4],int m[3][4]); void transpose(int arr[3][4]); int main() {β¦
continued....
In C++ an array variable is actually a
pointer variable that points to the first indexed variable of the array. Given the
following two variable declarations, p and a are the same kind of variable:
int a[10];
#def int* IntPtr;
IntPtr p;
* The fact that a and p are the same kind of variable. Since a is a pointer that points to a variable of type int (namely the
variable a[0]), the value of a can be assigned to the pointer variable p as
follows:
p = a;
After this assignment, p points to the same memory location that a points to. So, p[0], p[1], β¦ p[9] refer to the indexed variables a[0], a[1], β¦ a[9]. The square bracket notation you have been using for arrays applies to pointer variables as long as the pointer variable points to an array in memory
Β» You cannot change the pointer value in an array variable, such as a.
1 //Program to demonstrate that an array variable is a kind of pointer variable.
2 #include <iostream>
3 using namespace std;
4
5 #def int* IntPtr;
6
7 int main( )
8 {
9 IntPtr p;
10 int a[10];
11 int index;
12
13 for (index = 0; index < 10; index++)
14 a[index] = index;
15
16 p = a;
17
18 for (index = 0; index < 10; index++)
19 cout << p[index] << " ";
20 cout << endl;
21
22 for (index = 0; index < 10; index++)
23 p[index] = p[index] + 1;
24
25 for (index = 0; index < 10; index++)
26 cout << a[index] << " ";
27 cout << endl;
28
29 return 0;
30 }
#what_is_the_output_of_these_program?
https://t.me/+txk6Ik_UwGc4ZGM0
https://t.me/+txk6Ik_UwGc4ZGM0
In C++ an array variable is actually a
pointer variable that points to the first indexed variable of the array. Given the
following two variable declarations, p and a are the same kind of variable:
int a[10];
#def int* IntPtr;
IntPtr p;
* The fact that a and p are the same kind of variable. Since a is a pointer that points to a variable of type int (namely the
variable a[0]), the value of a can be assigned to the pointer variable p as
follows:
p = a;
After this assignment, p points to the same memory location that a points to. So, p[0], p[1], β¦ p[9] refer to the indexed variables a[0], a[1], β¦ a[9]. The square bracket notation you have been using for arrays applies to pointer variables as long as the pointer variable points to an array in memory
Β» You cannot change the pointer value in an array variable, such as a.
1 //Program to demonstrate that an array variable is a kind of pointer variable.
2 #include <iostream>
3 using namespace std;
4
5 #def int* IntPtr;
6
7 int main( )
8 {
9 IntPtr p;
10 int a[10];
11 int index;
12
13 for (index = 0; index < 10; index++)
14 a[index] = index;
15
16 p = a;
17
18 for (index = 0; index < 10; index++)
19 cout << p[index] << " ";
20 cout << endl;
21
22 for (index = 0; index < 10; index++)
23 p[index] = p[index] + 1;
24
25 for (index = 0; index < 10; index++)
26 cout << a[index] << " ";
27 cout << endl;
28
29 return 0;
30 }
#what_is_the_output_of_these_program?
https://t.me/+txk6Ik_UwGc4ZGM0
https://t.me/+txk6Ik_UwGc4ZGM0
Telegram
AlgoMasters : LearnToCode
'You can't be whatever you want until you start doing what you want.'
- Main contents of this channel ><
#website_development and #Mobile_app tips
#Machine_learning tip
#programmers_mindset
#technical_blogs
- Main contents of this channel ><
#website_development and #Mobile_app tips
#Machine_learning tip
#programmers_mindset
#technical_blogs
β€3π1
//a program that works average of n students' maths score
#include <iostream>
using namespace std;
int main(){
int sum,n,i,sub_total;
sum =0;
n = 1;
sub_total = 0;
cout <<"enter number of students: ";
cin >>n;
int array[sub_total];
for(i=1;i>=n;i++)
{ if(array[i]>=0){
cout <<"score of e student "<<i <<": " << endl;
cin >> array[i];
sum+= array[i];
}
}
cout <<"the sum is: " << sum << endl;
float average;
average = sum/n;
cout <<"the average is: " << average;
}
#include <iostream>
using namespace std;
int main(){
int sum,n,i,sub_total;
sum =0;
n = 1;
sub_total = 0;
cout <<"enter number of students: ";
cin >>n;
int array[sub_total];
for(i=1;i>=n;i++)
{ if(array[i]>=0){
cout <<"score of e student "<<i <<": " << endl;
cin >> array[i];
sum+= array[i];
}
}
cout <<"the sum is: " << sum << endl;
float average;
average = sum/n;
cout <<"the average is: " << average;
}
π₯1
//charging of parked car
#include <iostream>
using namespace std;
int main()
{
char type;
int charge, hours;
charge = hours* type;
cout <<"enter your vehicle 'c' 'b' 't': ";
cin >> type;
switch(char){
case 'c':
cout << "enter the parked hours: ";
cin >> hours;
charge = 2 * hours;
cout <<"your charged amount is $:\n" << charge;
break;
case 'b':
cout <<"enter hours parked: ";
cin << hours;
charge = 3 * hours;
cout <<" your charged amount is $:\n" << charge;
break:
case 't':
cout <<"enter the parked hours: ";
cin >> hours;
charge = 5 * hours;
cout <<"your charged amount is $:\n" << charge;
break;
}
}
#include <iostream>
using namespace std;
int main()
{
char type;
int charge, hours;
charge = hours* type;
cout <<"enter your vehicle 'c' 'b' 't': ";
cin >> type;
switch(char){
case 'c':
cout << "enter the parked hours: ";
cin >> hours;
charge = 2 * hours;
cout <<"your charged amount is $:\n" << charge;
break;
case 'b':
cout <<"enter hours parked: ";
cin << hours;
charge = 3 * hours;
cout <<" your charged amount is $:\n" << charge;
break:
case 't':
cout <<"enter the parked hours: ";
cin >> hours;
charge = 5 * hours;
cout <<"your charged amount is $:\n" << charge;
break;
}
}
π2
#include <iostream>
using namespace std;
int main()
{
char chr;
cout <<" Wel come to 'LEARN TO CODE' telegram channel.\n";
chr = 'j';
cout <<"Enter 'j' to join our channel." << endl;
cin >> chr;
cout <<"https://t.me/PROGRAMINGLANGUAGES1";
return 0;
}
thanks ππΏhttps://t.me/PROGRAMINGLANGUAGES1
using namespace std;
int main()
{
char chr;
cout <<" Wel come to 'LEARN TO CODE' telegram channel.\n";
chr = 'j';
cout <<"Enter 'j' to join our channel." << endl;
cin >> chr;
cout <<"https://t.me/PROGRAMINGLANGUAGES1";
return 0;
}
thanks ππΏhttps://t.me/PROGRAMINGLANGUAGES1
β€2
reference books for c++
1ππΏhttps://t.me/PROGRAMINGLANGUAGES1/34
2ππΏhttps://t.me/PROGRAMINGLANGUAGES1/30
3ππΏhttps://t.me/PROGRAMINGLANGUAGES1/85
4ππΏhttps://t.me/PROGRAMINGLANGUAGES1/88
1ππΏhttps://t.me/PROGRAMINGLANGUAGES1/34
2ππΏhttps://t.me/PROGRAMINGLANGUAGES1/30
3ππΏhttps://t.me/PROGRAMINGLANGUAGES1/85
4ππΏhttps://t.me/PROGRAMINGLANGUAGES1/88
Telegram
Learn To Code
nice material to explore your coding skill.π€, CODING is like building library that has many shelves to store book Β« "/*books represents data in coding*/; so you can sore books orderly to use it in case needed. By the way, coding needs not your past experienceβ¦
π1
DS286.AUG2016.Lab2_.cpp_tutorial.pdf
1.8 MB
now π€« c++ is no more difficultπππΏππΏππΏ
β€2π1
//C++ program for converting degree Celsius into Fahrenheit and vice versa
#include<iostream>
using namespace std;
int main()
{
float fahr, cel;
char option;
cout << "Choose from following option:" << endl;
cout << "1. Celsius to Fahrenheit." << endl;
cout << "2. Fahrenheit to Celsius." << endl;
cin >> option;
//option for converting celsius into fahernheit
if (option == '1')
{
cout << "Enter the temperature in Celsius: ";
cin >> cel;
fahr = (1.8 * cel) + 32.0; //temperature conversion formula
cout << "\nTemperature in degree Fahrenheit: " << fahr << " F" << endl;
}
//option for converting Fahrenheit into Celsius
else if (option == '2')
{
cout << "Enter the temperature in Fahrenheit: ";
cin >> fahr;
cel = (fahr - 32) / 1.8; //temperature conversion formula
cout << "\nTemperature in degree Celsius: " << cel << " C" << endl;
}
else
cout << "Error Wrong Input." << endl;
return 0;
https://t.me/PROGRAMINGLANGUAGES1
#include<iostream>
using namespace std;
int main()
{
float fahr, cel;
char option;
cout << "Choose from following option:" << endl;
cout << "1. Celsius to Fahrenheit." << endl;
cout << "2. Fahrenheit to Celsius." << endl;
cin >> option;
//option for converting celsius into fahernheit
if (option == '1')
{
cout << "Enter the temperature in Celsius: ";
cin >> cel;
fahr = (1.8 * cel) + 32.0; //temperature conversion formula
cout << "\nTemperature in degree Fahrenheit: " << fahr << " F" << endl;
}
//option for converting Fahrenheit into Celsius
else if (option == '2')
{
cout << "Enter the temperature in Fahrenheit: ";
cin >> fahr;
cel = (fahr - 32) / 1.8; //temperature conversion formula
cout << "\nTemperature in degree Celsius: " << cel << " C" << endl;
}
else
cout << "Error Wrong Input." << endl;
return 0;
https://t.me/PROGRAMINGLANGUAGES1
π1π₯1
ppt from chapter #3_#5 for c++ππ»π» https://t.me/PROGRAMINGLANGUAGES1
π1