C++ programming
#include<iostream>
using namespace std;
int main()
{
int amount1;
cin>>amount1;
int amount2;
cin>>amount2;
int sum=amount1+amount2;
cout<<sum;
return 0;
}
#include<iostream>
using namespace std;
int main()
{
int savings;
cin>>savings;
if(savings>500){
cout<<"road tripe with neha";
}
else if(savings>200) {
cout<<"road tripe with Rashmi";
}
else
{
cout<<"road tripe with friends";
}
return 0;
}
Class Student chart
#include <iostream>
#include <string>
using namespace std;
class Student {
public:
int rollNo;
string stdName;
float perc;
};
int main()
{
Student std;
std.rollNo = 101;
std.stdName = "Shivang Yadav";
std.perc = 98.20f;
cout << "Student's Roll No.: " << std.rollNo << "\n";
cout << "Student's Name: " << std.stdName << "\n";
cout << "Student's Percentage: " << std.perc << "\n";
return 0;
}
Comments
Post a Comment