Strong sales in men's, infants' and children' wear, and in cameras helped K mart Corp. the nation's third largest retailer, post a 20.8 percent in second-quarter earnings.

J. C. Penney Co., the No. 4 retailer, said improved catalogue sales boosted its second-quarter earnings by 19.7 percent.

K Mart reported after-tax earnings of $83.8 million (67 cents a share) in the second quarter compared with the same period last year when profits came to $69.4 million (56 cents).

Sales for the three months ended July 26 came to $2.8 billion, up 18.6 percent from last year's $2.3 billion.

First-half profit was $119.27 million (96 cents) on sales of $5.041 billion compared with $112.47 million (91 cents) on sales of $4.354 billion for the 1977 first half.

J. C. Penney Co. earnings rose to $41 million (60 cents a share) in the second quarter from $34 million (52 cents) for the same period last year.

For the 13 weeks ended July 29, sales rose 22.1 percent to $2.43 billion from $1.90 billion last year.

J. C. Penney earned $75 million ($1.12) in the first half of the year, up 17.1 percent from $64 million (98 cents) a year ago.