0% found this document useful (0 votes)
25 views1 page

C# Programming Tasks and Solutions

The document contains 4 programming problems. The first asks to write a program to obtain the average of even numbers from an 8-digit input. The second asks to print a pattern using a for loop. The third asks to write a program that reads 10 mobile numbers, identifies the network operator, and saves the count of each network in an array. The fourth asks to take a string as input containing only A-F, count the occurrences of each letter, and output the counts if valid.

Uploaded by

Mohtasham Khan
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
25 views1 page

C# Programming Tasks and Solutions

The document contains 4 programming problems. The first asks to write a program to obtain the average of even numbers from an 8-digit input. The second asks to print a pattern using a for loop. The third asks to write a program that reads 10 mobile numbers, identifies the network operator, and saves the count of each network in an array. The fourth asks to take a string as input containing only A-F, count the occurrences of each letter, and output the counts if valid.

Uploaded by

Mohtasham Khan
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

1.

If an 8-digit number is input through the keyboard, write a program to obtain the average of the all
even numbers. (3) Marks

2. Print this pattern on your console screen. (Using for Loop) (4) Marks

3. A country has four mobile phone network operators. Each mobile phone number has eight
digits. The first three digits identify the network operator: (5 Marks)
✔ 333 Ufore
✔ 345 Telenor
✔ 300 Jazz
✔ 321 Warid
Write C# Program, which reads 10 eight-digit mobile numbers and identify network and
save quantity network wise in an array.

4. Take string from user as input. This string can only have alphabets A-F. If any other characters are
included reject the string and end program. If the string is valid then output count of each
alphabet occurring in that string. Like,
Input : ACEAOB (8) Marks
Output: A(2) B(1) C(1) D(0) E(1) F(0)
Hint: using array

You might also like