Skip to main content
C++ program that inputs five floating-point values in an array and displays the values in reverse order. Program: #include<iostream> using namespace std; int main() {     float arr[5];     int i, num;     cout<<" How many numbers do you want to Enter: ";     cin>>num;     cout<<" Enter "<<num<<" numbers: ";     for(i=0; i<5; i++)         cin>>arr[i];     cout<<"\nThe Original Array is:\n";     for(i=0; i<5; i++)         cout<<arr[i]<<" ";     cout<<"\n\nThe Reverse of Given Array is:\n";     for(i=(5-1); i>=0; i--)         cout<<arr[i]<<" ";     cout<<endl;     return 0; } Output:

C++ program that inputs five floating-point values in an array and displays the values in reverse order.


Program:

#include<iostream>

using namespace std;

int main()

{

    float arr[5];

    int i, num;

    cout<<" How many numbers do you want to Enter: ";

    cin>>num;

    cout<<" Enter "<<num<<" numbers: ";

    for(i=0; i<5; i++)

        cin>>arr[i];

    cout<<"\nThe Original Array is:\n";

    for(i=0; i<5; i++)

        cout<<arr[i]<<" ";

    cout<<"\n\nThe Reverse of Given Array is:\n";

    for(i=(5-1); i>=0; i--)

        cout<<arr[i]<<" ";

    cout<<endl;

    return 0;

}

Output:






Comments

Popular posts from this blog

Tecno: Tecno Mobiles new & latest Model 2020

 Tecno: Tecno Mobiles new & latest Model 2020 Tecno is a Chines mobile phone maker that established back in 2006. For two years, its business has focused on the South Asian market. In a short period,  Tecno Mobiles   has become a threat to major smartphone brands in Pakistan, which is a fantastic success. The main reason people started buying its phones is its mid-range prices. Tecno is giving a competitive edge to many major smartphone brands. Tecno Mobile is a mobile phone brand that's owned by Hong Kong-based Transsion Holdings, which in 2017 launched another mobile brand in India - Itel. Thus, Techno Mobiles was established in 2006. Hence, Techno's latest mobile launch is the Spark 6 Air (64GB). However, The smartphone launched on 21st September 2020. The phone comes with a 7.00-inch touchscreen display with a resolution of 720 pixels by 1640 pixels. The Tecno Spark 6 Air (64GB) powers by a quad-core MediaTek Helio A25 processor and it comes with 3GB of RAM. Thus, Th

iPhone 12: Problems with iPhone 12 series

 iPhone 12: Problems with iPhone 12 series Apple is expected to launch four new iPhones under the  iPhone 12 series and now a new report suggests. That one of the camera lens suppliers for the upcoming non-Pro  iPhone 12 models is facing quality issues. According to Apple analyst Ming-Chi Kuo, Genius Electronic Optical has discovered issues with cracking coatings on the wide-angle camera lens destined for the lower-end 5.4-inch and 6.1-inch models. The problem appeared during high-temperature/high-humidity (HTHH) testing, reports MacRumors. The iPhone 12 and iPhone 12 Pro promise the biggest update in years. Here's what we know so far. iPhone 12 and iPhone 12 Pro : We're very close to finally getting to see the new iPhone 12 and iPhone 12 Pro models from Apple. And these phones promise to feature some of the biggest changes to the iPhone lineup in a long time. It will reportedly drop the existing design for an all-new look, as well as add 5G connectivity across the range,

SAMSUNG: SAMSUNG Smartphones Latest Model

 SAMSUNG: SAMSUNG Smartphones Latest Model Here you will find all the best. And top-rated mobile phones of the Samsung  brand. Thus, and their respective prices beneath each product. Hence, It is a South Korean electronics manufacturing company based in Suwon, South Korea. However, The company started its journey. By developing electrical and electronic devices. Like calculators, air conditioners, washing machines, televisions, and refrigerators. Thus, They expanded their business. By stepping into the mobile phone market. Since then It became a leading name in the industry. Thus, surpassing the other big names in the market. The product list of Samsung includes the smartphone, LED TV, Laptops, Smartwatch, Washing machines, and many more. Since 2006, Samsung has been the world’s largest mobile phone brand worldwide. However, It has also been a major manufacturer of electronic components. Thus, like lithium-ion batteries, semiconductors, chips, flash memory. And hard drive devices fo