Technology has advanced to the point where programming has become an essential part of our lives. We use software and applications for communication, entertainment, education, and work, and these are all built on programming languages.
Program to print name of a day using switch case statement.
Get link
Facebook
X
Pinterest
Email
Other Apps
Explanation:
Here number is inputted in variable 'day' and when it is equivalent with day in week and matches the preceeding case, it will print whatever in the block given.
a. Communication is the process of sharing message from one point to another. True b. In half duplex mode of communication, data can be transmitted in both the directions simultaneously. False c. Metropolitan Area Network connects two or more LAN together with in a large city or state. True d. Computer network allows sharing of software only. False e. Coaxial cable has much greater bandwidth than fiber optic cable. False f. A gateway is a network device which connects two dissimilar networks together. True g. Each computer or device in a network is called node. True h. Peer to peer is a network which has more security than client server. False
Here, two numbers are requested from the user and placed in 'a' and 'b' variable using scanf. The value of the variable are checked using 'if' structure. If value in a is greater than value of a will be displayed as greater else value of b is displayed as greater number in comparision. Output
P rime Numbers are those which have only 2 factors; by 1 and by themselves own. For examples, the first five prime numbers are 2,3,5,7 and 11. These numbers are divisible by 1 and by themselves. Here, we have to print prime numbers from 1 to 100. So, we have to use for loop. The nested for loop works here, one by variable 'a' and another by 'b' and an increment number is also stored in 'p'. The first loop starts from 1 and inside it, another loop begins until the value of b becomes greater then a. If the remainder when a is divided by b becomes 0. The value of p incremented by 1. If the value is 2 means that first loop also has moved for 2 and value of a is 2. And, so it get printed. The first prime number is extracted and now whenever the divisible of a by b becomes 0, the value inside a gets printed and we will get all the prime numbers. The Output
Comments
Post a Comment
If you have any doubt, let me know...