.C Language Help: Counting Zeroes, Evaluating Series, and Reversing Numbers

In summary, The person is asking for help with three questions related to C language. They are asking for assistance with writing a program to count the number of zero's, one's, blank spaces, and other characters using switch statement, evaluating a series, and printing a number in reverse order. They are a beginner in C and do not have full knowledge of the language. The person asking for help is advised to provide specific questions and attempt to write the programs themselves.
  • #1
manipalmps
3
0
could some1 help me in these 3 questions of C language

Q1
Write a program to count the number to count the number of zero’s, one's, blank spaces and other characters using switch statement.

Q2
Write a program to evaluate the series
x-(x^3)/3!+)(x^5)/5!-(x^7)/7! ... up to (x^n)/n!

Q3
Write a program to print the entered number in reverse order
 
Physics news on Phys.org
  • #2
Sure, we're here to help, but we're not going to do the work for you. First, you have to show us some work, or at least ask a more specific question. Don't be ashamed if you think or know it is wrong: a failed attempt is better than no attempt at all.

Otherwise we have no idea at all about your level of programming. Like: do you know how to write and compile a C program? Do you know about variables, loops, arrays, ...? Are you having problems converting the question to an algorithm or just implementing the algorithm in C?
 
  • #3
bro i am a newbie to c
actually i have no idea for 1st and 2nd
i know a bit but not in full detail
 
  • #4
Surely you must have some idea... if this is homework/coursework, I can't imagine that your teacher would have you write such programs without any knowledge of C at all.
For Q1, for example, you should at least know how to read a string from keyboard, how to loop through its characters and how a switch statement works. Do you know about cin/getline, for, and switch?
 
  • #5
for,switch i know
 
  • #6
So you can start by writing out as specifically and step-by-step as possible what your program should do. For example:

>Start of program
- Ask the user for input string
- Make four counters for zero, one, space and other
- Initialize the counters to zero
- ...
- ...
 
  • #7
manipalmps said:
bro i am a newbie to c
actually i have no idea for 1st and 2nd
i know a bit but not in full detail

We do not do your work for you. If you have a specific question, post it. If you want us to do your schoolwork for you, you are at the wrong website.
 

1. How do I count the number of zeroes in a given array using C language?

To count the number of zeroes in a given array, you can use a loop to iterate through each element of the array and check if it is equal to zero. If it is, then you can increment a counter variable. Once the loop finishes, the counter variable will contain the total number of zeroes in the array.

2. How do I evaluate a series using C language?

To evaluate a series in C language, you can use a loop to iterate through the terms of the series and add them together. You can also use the math library functions to perform any necessary calculations. Make sure to check for any conditions or restrictions specified in the series before evaluating it.

3. How do I reverse a given number using C language?

To reverse a given number in C language, you can use a loop to extract each digit of the number and store them in an array or a string in reverse order. Then, you can use the string or array to construct the reversed number. Another approach is to use the modulus and division operators to extract and reverse the digits of the number.

4. Can I use C language to perform mathematical operations?

Yes, C language has a variety of built-in functions and libraries that allow for mathematical operations. These include the math library, which provides functions for basic mathematical operations such as addition, subtraction, multiplication, and division. You can also use the modulus and division operators to perform arithmetic operations.

5. Are there any resources available for learning C language?

Yes, there are many resources available for learning C language, including online tutorials, books, and courses. You can also refer to the official C language documentation for more information on the language and its features. Additionally, there are many online forums and communities where you can ask for help and learn from experienced C programmers.

Similar threads

  • Engineering and Comp Sci Homework Help
Replies
8
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
4
Views
3K
  • Engineering and Comp Sci Homework Help
Replies
22
Views
4K
  • Engineering and Comp Sci Homework Help
Replies
21
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
9
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
2
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
7
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
5
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
12
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
6
Views
2K
Back
Top