1. Write a C program using an online C compiler that implements the following:-
• Declare a floating-point variable (of type float)
• Declare an integer variable (of type int)
• Prompt the user to enter a floating-point number.
• Read a number from the keyboard into your floating-point variable
• Using casting, write the contents of your floating-point variable into your integer variable • Display the value of your integer variable.
Department Number of Users
Customer Care 10
Sales and Marketing 20
Finance 25
Legal 5
HR 10
Developers 55
Network Team 5
Server Room
Servers +ISP connections
· High level of redundancy is expected in network design to eliminate single point of failures and traffic bottle necks.
· Sales and Marketing Team need to access Network resources using WIFI connectivity.
· Proper methods for networking monitoring and troubleshooting need to be established.
· All possible network security mechanisms should be implemented.
Department Number of Users
Customer Care 10
Sales and Marketing 20
Finance 25
Legal 5
HR 10
Developers 55
Network Team 5
Server Room
Servers +ISP connections
· High level of redundancy is expected in network design to eliminate single point of failures and traffic bottle necks.
· Sales and Marketing Team need to access Network resources using WIFI connectivity.
· Proper methods for networking monitoring and troubleshooting need to be established.
· All possible network security mechanisms should be implemented.
Write a program For example, if the given numbers are M is 4 and N is 16, the perfect squares from 4 to 16 are 4(2 * 2), 9(3 * 3), and 16(4 * 4), as the first perfect square is 4. So the output should be 4.
Else print No perfect Square
Add two polynomials
Given two polynomials A and B, write a program that adds the given two polynomials A and B.
Input
The first line contains a single integer M.
Next M lines contain two integers Pi, Ci separated with space, where Pi denotes power and Ci denotes co-efficient of Pi for polynomial A.
After that next line contains a single integer N.
Next N lines contain two integers Pj, Cj separated with space, where Pj denotes power and Cj denotes co-efficient of Pj for polynomial B.
Output
Explanation
If M = 4 and for polynomial A
For power 0, co-efficient is 5
For power 1, co-efficient is 0
For power 2, co-efficient is 10
For power 3, co-efficient is 6.
If N = 3 and for polynomial B
For power 0, co-efficient is 1
For power 1, co-efficient is 2
For power 2, co-efficient is 4.
Then polynomial A represents "6x^3 + 10x^2 + 5", the polynomial B represents "4x^2 + 2x + 1" and the addition of A and B is "6x^3 + 14x^2 + 2x + 6"
Appearance of water
1. In the following program, what would be the final output? Explain in
detail.
void copyarr( char ∗p1 , char p2 [ ] ) {
memcpy ( p2 , p1 , size of ( p1 ) ) ;
memcpy ( p2 , ‘ ‘ABCD’ ’ , 4 ) ;
}
int main ( ) {
char arr1 [ 100 ] ;
char arr2 [ 100 ] ;
printf( ‘ ‘ Enter a string : ’ ’ ) ;
scanf ( ‘ ‘%[ ˆ\n ] s ’ ’ , arr1 ) ;
copyarr ( arr1 , arr2 ) ;
printf ( ‘ ‘ \ n %s ’ ’ , arr2 ) ;
return 0 ;
}
Write a program that allows any number of values between 0 and 10 to be entered. When the user stops entering values, display a frequency distribution bar chart. Use asterisks to show the number of times each value was entered. If a given number is not entered, no asterisks should appear on that line. Your application should display error messages if a value outside the acceptable range is entered or if a non-numeric character is entered.
Write a program that reads data into an array of type int. Valid values are from 0 to 10. Your program should display how many were inputted as well as the number of invalid entries. Output a list of distinct valid entries and a count of how many times that use the following test data
1 7 2 4 2 3 8 4 6 4 4 7
Write a program to enter the numbers till the user wants and at the end it should display the
count of even, odd and prime numbers entered.