1- Write a program that takes a number n (between 1 and 999) from the user and finds “how many times the digits 4 and 9 occurs from 1 to n”.

Example :
Input: 100
Output: 40


(because 4 9 14 19 24 29 34 39 49 41 42 43 44 45 46 47 48 49 54 59 64 69 74 79 84 89 90 91 92 93 94 95 96 97 98 99)



2- Write a C# program that takes a number from the user and prints one of the followings:
- pentagonal and heptagonal
- Not pentagonal but heptagonal
- Pentagonal but not heptagonal
- Neither pentagonal nor heptagonal

A pentagonal number is a number of the form Pn = n(3n−1)/2.
The first few are 1, 5, 12, 22, 35, 51, 70, 92, 117, 145, 176, 210, 247, 287, 330, 376, 425, 477, 532, 590, 651, 715, 782, 852, 925, 1001... etc.

A heptagonal number is a number of the form Hn = n(5n-3)/2.
The first few are 1, 7, 18, 34, 55, 81, 112, 148, 189, 235, 286, 342, 403, 469, 540, 616, 697, 783, 874, 970, 1071... etc.

Examples:
Input: 4347
Output: pentagonal and heptagonal

Input: 590
Output: Pentagonal but not heptagonal


bu iki soruyu c# da kodlarına ıhtıyacım var yalnız for , if , while ve switch dongulerı goruldu bunlar kullanılarak yapılmalı yardım edebilecek olursa cok buyuk yardımı dokunur sımdıden tesekkur edıyorum