{"id":9189,"date":"2021-09-30T12:00:32","date_gmt":"2021-09-30T06:30:32","guid":{"rendered":"https:\/\/python-programs.com\/?p=9189"},"modified":"2021-11-22T18:39:30","modified_gmt":"2021-11-22T13:09:30","slug":"print-all-integers-that-arent-divisible-by-either-2-or-3-and-lie-between-1-and-50-in-cpp-and-python","status":"publish","type":"post","link":"https:\/\/python-programs.com\/print-all-integers-that-arent-divisible-by-either-2-or-3-and-lie-between-1-and-50-in-cpp-and-python\/","title":{"rendered":"Print all Integers that Aren\u2019t Divisible by Either 2 or 3 and Lie between 1 and 50 in C++ and Python"},"content":{"rendered":"

In the previous article, we have discussed about Allocating and deallocating 2D arrays dynamically in C++<\/a>. Let us learn how to Print all Integers that Aren\u2019t Divisible by Either 2 or 3 and Lie between 1 and 50 in C++ Program.<\/p>\n

The task is to print all the numbers from 1 to 50 which are not divisible by 2 or 3 in C++ and Python.<\/p>\n

Sample Output:<\/strong><\/p>\n

The numbers from 1 to 50 which are not divisible by 2 and 3 are:\r\nNumber =  1\r\nNumber =  5\r\nNumber =  7\r\nNumber =  11\r\nNumber =  13\r\nNumber =  17\r\nNumber =  19\r\nNumber =  23\r\nNumber =  25\r\nNumber =  29\r\nNumber =  31\r\nNumber =  35\r\nNumber =  37\r\nNumber =  41\r\nNumber =  43\r\nNumber =  47\r\nNumber =  49<\/pre>\n

Print all Integers that Aren\u2019t Divisible by Either 2 or 3 and Lie between 1 and 50 in C++ and Python<\/h2>\n

Grab the opportunity to learn all effective java programming language concepts from basic to advance levels by practicing these Java Program Examples with Output<\/a><\/p>\n

There are several ways to print all the numbers from 1 to 50 which are not divisible by 2 or 3 some of them are:<\/p>\n