100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached
logo-home
C++ practice programs. $10.49   Add to cart

Class notes

C++ practice programs.

 3 views  0 purchase
  • Course
  • Institution

this are the program notes in which there are all programs that we can practice.

Preview 4 out of 72  pages

  • May 27, 2024
  • 72
  • 2023/2024
  • Class notes
  • S.b. regude sir
  • All classes
avatar-seller
Q1. write a program to perform operations on constant.
#include <iostream>
using namespace std;
int main()
{
double d;
d=10+28.05+ 'A'+ 017;
cout<<"d = "<<d;
return 0;
}


Q2. Write a program to print friend list.
#include <iostream>
using namespace std;
int main()
{
cout<<"sanika\n"<<"pavar\n"<<"xyz\n";
return 0;
}


Q3. programming example to print addition of two constant
numbers
#include <iostream>
using namespace std;
int main()

, {
int a=10;
int b=20;
int c;
c=a+b;
cout<<"addition of "<< a << " and "<< b <<" is "<< c;
return 0;




Q 4. Write a program to declare value for variable a and b
print its addition, subtraction multiplication and division
#include <iostream>
using namespace std;
int main()
{
int a,b,c;
cout<<"\n enter value for a= ";
cin>>a;
cout<<"\n enter value for b= ";
cin>>b;
c=a+b;
cout<<"\nadd = "<<c;
c=a-b;
cout<<"\nsub = "<<c;
c=a/b;

, cout<<"\ndiv = "<<c;
c=a%b;
cout<<"\nMod = "<<c;
c=a*b;
cout<<"\nmult = "<<c;
return 0;
}


Q5. Write a program to declare two-digit number to variable
n and print its reverse of n;
#include <iostream>
using namespace std;
int main()
{
int n,r;
cout<<"\n enter a number = ";
cin>>n;


r=(n%10)*10+(n/10);
cout<<"\n rev of "<< n <<" = "<< r;
return 0;
}


Q6. Write a program to print reverse of three digit
#include <iostream>

, using namespace std;
int main()
{
int n,r;
cout<<"enter a number= ";
cin>>n;


r=(n%10)*100+((n/10)%10)*10+(n/100);
cout<<"rev = "<<r;
return 0;
}


Q7. Write a program to enter product cost and calculate GST
and total.
#include <iostream>
using namespace std;
int main()
{
float pc,gst,gstper,total;
cout<<"enter product cost = ";
cin>>pc;
cout<<"enter gst percentaage = ";
cin>>gstper;


gst=pc*gstper/100;

The benefits of buying summaries with Stuvia:

Guaranteed quality through customer reviews

Guaranteed quality through customer reviews

Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.

Quick and easy check-out

Quick and easy check-out

You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.

Focus on what matters

Focus on what matters

Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!

Frequently asked questions

What do I get when I buy this document?

You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.

Satisfaction guarantee: how does it work?

Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.

Who am I buying these notes from?

Stuvia is a marketplace, so you are not buying this document from us, but from seller dnyaneshwarshinde1503. Stuvia facilitates payment to the seller.

Will I be stuck with a subscription?

No, you only buy these notes for $10.49. You're not tied to anything after your purchase.

Can Stuvia be trusted?

4.6 stars on Google & Trustpilot (+1000 reviews)

77858 documents were sold in the last 30 days

Founded in 2010, the go-to place to buy study notes for 14 years now

Start selling
$10.49
  • (0)
  Add to cart