HTMLWHALE-site-logo
  • HOME
  • C++ Basics
  • C++ Videos
  • JS Lessons
  • JS Codes

C++ 1 dimensional Arrays Programs


Here we Provide C++ programs on 1 dimensional Arrays for Practice.




Program 1

Program to find total score and average of marks using Array


Output



Program 2

Program to find the largest number in an Array


Output



Program 3

Program to find the Smallest number in an Array


Output



Program 4

Print the numbers in an Array in ascending order


Output



Program 5

Print the numbers in an Array in descending order


Output



Program 6

How to Find the negative numbers in an Array


Output



Program 7

Find the total number of Negative numbers present in the array


Output



Program 8

How to find all the Even and Odd numbers in an Array


Output



Program 9

How to find the sum of all the Elements in an Array


Output



Program 10

Program to find the number of occurences of Elements in an Array


Output

Explanation: First, we define an array called arr with 7 elements. We use a nested for loop to compare each element of the array with the other elements to find the frequency of each element. The outer loop runs from i = 0 to i = 6 (i.e., 7 iterations). For each value of i, we initialize a variable called freq to 1. We use another nested loop (with variable j) to compare the element at index i with the elements after it (i.e., starting from index i+1). If the element at index i is equal to the element at index j, then we increment the frequency counter freq and set the element at index j to -1. Setting the element to -1 ensures that we don't count it again in the outer loop. After the inner loop completes, we check if the element at index i is not equal to -1. If it's not equal to -1, then we print out the element and its frequency. The program then returns 0 to indicate successful completion.



Program 11

How to find the Second largest number in the Array


Output

Back to Top

Comments

Read what our users ought to say: CseaSee.com


100 comments
  • Macy:

    Jun 10, 2015 at 9:00 am
    After serving as a praactical nurse at various deployments I found myself at crossroads of life when retirement hit me. With a family to feed and not an extra dime over to what meagre sum you got after retirement, I felt badly desperate, disheartened, dijected. Always questioning what my tomorrow is going to look like. It was then I came across a job consultant who gave the bitter truth. That with my present skill sets all I would be offered is a care giver job with long hours and minuscule pay, and if I had to earn a decent living, I should invest in up grading my skillset. It was then he suggested me cseasee.com, and how the entire Coding part of C++ is delivered with lucidity so that even a first timer like me would be able to understand and complete the course. Plus the entire content is free unlike those others who placed their courses behind a stone wall called payment gateway. Today, my life is changed and I have an employement which has granted me freedom, respectability and a promising future. Thank you, Cseasee.com
    Reply
  • Daniel:

    Aug 31, 2016 at 10:10 am
    I always thought hard work and dedication is sufficient enough to earn you a decent livelihood. So I joined a premier university and completed a masters in personnel management. This is not to mention the amount of student loan that I have amassed during this journey. When the job hunt came, then the true reality set in. The entry level jobs paid ruthlessly a paltry sum, which I could have very well earned if I had just invested the money that I spent on my education. Anyway, to cut the long story short, I took one such offers and stayed on it thinking that one fine day, I would see myself owing a two bedroom flat, not a villa but a flat. Was this dream too big to achieve? Apparently it turned out to be. With 8 years in the same industry, all I mustered to buy was a 12 carat gold plated watch. Yes, my situation was so deplorable that I was treated like a door mat by my boss. Then one fine day I coincidentally came across this magazine where individuals share their paths to success. It was there I read this story how a cafeteria assistant spent his leisure learning to code C++ from classes run by cseasee.com, and that it was this endeavor that changed his life. It was right then I decided to call it quits and delved into learning C++. Today am thankful to the testimony shared by the young man and to cseasee.com, for providing service to all those who have desire to learn to code.
    Reply
  • Cassandra

    Nov 5, 2021 at 9:00 am
    It is not always easy to find things on the internet if quality and substance is also a requirement for the content that you are looking for. Yes, the internet has tons and tons of information, but how many such information would fit the yardstick thus mentioned. I searched for C++ content on popular social medias. They all had great thumbnails, and intros, but the treatment of the language as such was not beginner friendly. And the irony is these videos had tons of views. So I ask myself, if a beginner like me finds these videos pathetically discouraging and unfriendly, then where the views coming from? Then I knew like in many areas, the best are always sidelined due to lack of publicity and those that make more noises are always on the top for the simple reason that their agenda is not to help deserving individuals who have the passion but not the finances to foot the bill for learning. So no social media would want to promote them, for these so called social medias never want to help the poor and the needy. So I told myself, I should get out there and promote deserving sites whose core aim is to help, serve and provide. Cseasee.com, is a site that puts the cause of learners above everything else and if not for them, I wouldn't have a bed and a nice breakfast welcoming me every single day. Thank you, Cseasee.com. :)
    Reply
  • Jonathan Bill:

    Aug 4, 2017 at 11:00 am
    All of my friends are talking about htmlwhale. I've even heard my mother talking about this when I expressed my desire to get into coding, and she was quick to point out as to how her friend's daughter had used it to clear a tech interview and that I should waste no time in shuttling with my decision. So here I am, going through every bit of the knowledge without shelling out huge sums of money. :)
    Reply
  • Mandy Wilson: Aug 4, 2017 at 11:04 am

    I'm a 30-year-old woman working for a fastfood joint, working 70hrs a week and this I did for 10 years. Everyday I had to wake up at 5am just to be able to reach my workspot on time to prepare the morning breakfast. It was then as by chance I met one of my former colleagues who used to work with me and it was he who gave me tap on my back. Infact, I could hardly recognize him, he was all bright. I never knew him that way, and ventured out with commentness to ask him the cause for his change. He spilled beans of lifechanging advice in a minute. All he said was, "Mandy, if you only were to work just half the working hours that you put here in, on your future, you could just live the way I live"It was as if a bolt struck me.From then on there was no turning back. Today, I am a webdesigner, and I am extremely greatful for all of the content and guidance that HTMLWHALE.com, has provided me.
    Reply
  • Dana Dowson:

    Aug 4, 2017 at 11:04 am
    I'd been trying to learn html for ages but often failed in my attempts. One main reason I would say is the lack of available content to have a grasp of the subject. Of course they say that there are a lot of websites that do provide Html content, but the major flaw in all of them is their inability to start the subject from basics and then gravitate towards proficiency. However, thankfully, I have found HTMLWHALE.com, and in all honesty, this is the only site that I have found to answer to all of the needs that any begineer would have. Today, I work in web developement and I attribute my succes to htmlwhale.com:)
    Reply
  • Sophia Fryer:

    Aug 4, 2017 at 11:04 am
    I was doing fairly well in school when I had to drop out because of low funds and I didn't like the idea of studying on debt. For I know with the changing world, only things that had direct application to solving people's problems had relevance. So I was always on the lookout for an opportunity that would allow me to work and study. This opportunity was offered to me by HTMLWHALE.com, which gave away technical knowledge free of cost to all those who are willing to accept and improve. Today, I have a small web development business. Of course, I cannot claim to know everything in webdevelopment, but I have HTMLWHALE.com, for reference and study, and that gives me the confidence I need to conquer.happiness!:) AMAZING, UNBELIEVABLE!
    Reply
c++_logo-img

C++ Practice Lesson Index-Arrays

  • First ProgramProgram to find total score and average of marks using Array

    Second ProgramHow to find the Largest number in an Array

    Third ProgramHow to find the Smallest number in an Array

    Fourth ProgramPrint the numbers in the Array in Ascending order

    Fifth ProgramPrint the numbers in the Array in Descending order

    Sixth ProgramFind all Negative numbers in an Array

    7th ProgramFind the count of all Negative numbers in an Array

    8th ProgramFind the Even and Odd numbers in an Array

    9th ProgramHow to find the sum of all the Elements in an Array

    10th ProgramTo check the number of Occurences of Elements in an Array

    11th ProgramTo find the Second largest number in an Array

  • HTML study Videos:

    Complete set of Fullstack web Development that provides you with every skillsets to launch your Career.

  • CSS Lessons:

    A detailed tutorial on how CSS works. CSS is single handedly responsible in styling web pages without CSS, there isn't going to be any design and presentation on the web. So learn it now. Click Here

  • JS Lessons:

    The life for any web page is brought into existence by JavaScript knowledge of JS, makes a developer invincible to the job market. For the simple reason, he has the craftmanship to exist in any environment. Click Here

I cleared three interviews for a top tier company and the HR informed me of a final interview with the board of directors. I was excited and I told myself that it is just a formality. I walked in with all confidence to meet with board, and with initial greetings, I was asked the first question from an elderly looking man at the head table, “are you comfortable working with C++?”. I leaned back and said, “am comfortable with Java” and then showed them my 7 year experience in JDE. They said, I will be contacted, and I left with a deep down feeling, I have got the offer. Three days later, the HR contacts me to say, though I had all the requirements for the position, yet, without C++, the board has decided that you are not suitable for the position. I immediately responded, well I could always learn C++. To this the HR replied, “But Sarah, you never told them that”. It was a great offer and for sure could have changed my life’s path in many ways, but my rigidity and ignorance swayed me away. My advice to all developers, learn C++ if you want to reach there! -Sarah J-Game Developer What we fail to understand is that, though there is vast information resources floating everywhere, yet we don't see many using them to upgrade and uplift their economical condition. One main reason is that these so called availability of information is not well organized, meaning if you were to ask someone to use them, they would simply have no clue at all.So the underlying point to all of these pandemonium of chaos is, not provind content in the way they ought to be provided. Thankfully, my team and I have found a way out and that would be to use,HTMLWHALE.com. In all these years of my experience in using them and recommending them to others, the single most reaction that all of its users received is this, that the site is so well organized in content that any begineer on meticulous use of the site can and will become a pro at webdevelopment in weeks. This is so good for it would do wonders to all those who are aspiring to make their way into webdevelopment. Thanks a lot, you guys are indeed my heroes! -Martha Heyworth-CMO

C Complete

  • C Knowlege is Power:

    Get C learning guide. We, adopts a step by step method in providing you knowledge and tools required to conquer the invincible C

C++ Complete

  • C++ Knowlege is Power:

    Watch C++ Lessons CseaSee.com learning guide. CseaSee.com, adopts a step by step Approach in providing you with C++ knowledge and tools, thus making to industry ready

JAVA Complete

  • Java Knowlege is Power:

    Watch Java Lessons CseaSee.com learning guide. CseaSee.com, adopts a step by step Approach in providing you with Java knowledge and tools, thus making to industry ready

  • Terms and Conditions
  • Privacy Policy
  • Contact
© 2022CseaSee.com™ .All Rights Reserved
  • Complete C++ Training-from Basics to Advance Start Today: Real POWER
  • Contact Us Here