Home Task #1 Programming Fundamentals girls 1C/B

 

Q1. Write a program in C++ to print absolute value of a number entered by user.

Sample output:
INPUT: 10       OUTPUT: 10
INPUT: -10        OUTPUT: 10

Q2. A student will not be allowed to sit in exam if his/her attendance is less than 75%.
Take following input from user
Number of classes held
Number of classes attended.
And print
percentage of class attended
Is student is allowed to sit in exam or not.

Q3. Write a program in C++ to check whether a entered character is lowercase ( a to z ) or uppercase ( A to Z ).

Q4. Take two int values from user and print greatest among them. For example, number1=10 and number2=20 your program should print number2 is greater than number1.

Q5.  Write output of the following code:

if(0)

{

       cout<<"Hello world";

}

else

{

       cout<<"Hello there";

}

Q6. Write output of the following code:

if(-100)

{

       cout<<"Hello world";

}

else

{

       cout<<"Hello there";

}

Q7. Write output of the following code:

int x=1;

 

cout<<x++ + ++x + ++x + --x + x-- + x++;

 

 

Q8.  Write a program in C++. Your program should check the entered value rang and print the ASCII Value of the entered character. For example, if the user enter A then your output will be 65.

Q9. Write a program in C++ your program should take two numbers from the user and compute their square using building functions and check which number’s square is greater.

Submission Link:


Post a Comment

Previous Post Next Post