a 22LR rifle will cost you around $200-300. A box of 50 rounds will cost you $2
a 223 rifle like an AR-15 will cost you $600, a box of 50 rounds will cost you $20
that being said, a 22LR is for shooting paper targets, squirrels, rabbits, and the like at 20 to 50 yards. A 223 is a potent man-stopper, can be used for paper targets out to 500 yards, is often used to shoot small animals at 200-300 yards, if used for rabbits and squirrels at close range will blast them apart, makes a great long range coyote gun, and in some places can be used to hunt deer.
it all depends on which one more fits your needs. Most people are best served by a good 22LR rifle, something like a Ruger 10/22. Even people with AR-15s will often also own a nice 22LR rifle just because the gun is so inexpensive and the ammo is so affordable, it pays for itself.