C++ Assignments 2 Week1_marked
C++ Assignments 2 Week1_marked
#include <iostream>
int main()
{
int x;
cout << "Enter first number\n";
cin >> x; // user will give ‘x’ a value.
int y, m;
cout << "Enter second number and value for taking modulus\n";
cin >> y >> m; // user will give ‘y’ a value.
int Z = (x * y) % m;
cout << "Output is: " << Z;
#include <iostream>
int main()
{
int x;
cout<<"Enter first number\n";
cin>>x; // user will give 'x' a value.
int y;
cout<<"Enter second number\n";
cin>>y; // user will give 'y' a value.
cout<<(x!=y)<<" "<<(x>=y);
}
int main()
{
int x,y;
cin>>x>>y;
x+=y;
x-=y;
x%=y;
cout<<x;
}
WAP for finding the volume of the cylinder by taking radius and height as input.
WAP to find the difference between ASCII of two characters ,take them as input .
Find the output of the below code
#include <iostream>
int main()
{
int i = ( 4 + 7 / 5 * 6 * 6+9 )% 100 ;
cout<<i;
}
Note:- Please try to invest time doing the assignments which are necessary to build a strong
foundation. Do not directly Copy Paste using Google or ChatGPT. Please use your brain .