Currently computer engineering major possibly wanting to change idk

Hey guys!

I’m new to the forum and here’s a little about me: I’m currently a sophomore undergraduate student studying computer engineering, formerly studying energy engineering. I feel super unsure about my major and just don’t know where to go from here. I switched from energy to computer engineering because I wasn’t doing too well with the chemistry aspect and took a class in C programming and fell in love with it! Lately I’m feeling unsure as I’m not receiving the best grades in my programming class I’m taking this semester and its really making me question things. I’m feeling like 1) I’m not cut out for this major and 2) I’m questioning whether or not I’ll be happy with this for the rest of my life. I really love math and have always enjoyed it and have also enjoyed science so I definitely want to stay in the stem field, I’m just having trouble figuring out where exactly I should go in the stem field. I’ve questioned majoring in pure mathematics but I really just don’t know. If someone could help me and hear my cry for help that would be amazing and very appreciated!