0% found this document useful (0 votes)
4 views2 pages

C++ Assignments 2 Week1_marked

The document contains C++ programming assignments for Week 1, including tasks to find outputs for given code snippets based on user inputs. It emphasizes the importance of understanding the concepts rather than copying solutions from online sources. Additional assignments include calculating the volume of a cylinder and finding the ASCII difference between two characters.

Uploaded by

patarisuvrajit01
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views2 pages

C++ Assignments 2 Week1_marked

The document contains C++ programming assignments for Week 1, including tasks to find outputs for given code snippets based on user inputs. It emphasizes the importance of understanding the concepts rather than copying solutions from online sources. Additional assignments include calculating the volume of a cylinder and finding the ASCII difference between two characters.

Uploaded by

patarisuvrajit01
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

C++ Assignments 2 | Week1

Find the output for this code. Let input:- 2 3 6

#include <iostream>

using namespace std;

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;

Find the output for this code. Let input:- 3 2

#include <iostream>

using namespace std;

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);
}

Find the output for this code. Let input:- 2 3


#include <iostream>

using namespace std;

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>

using namespace std;

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 .

You might also like