Answer Posted / sharon
WAP in C to print series of odd no. upto the given num. using function and with arguments
#include<stdio.h>
#include<conio.h>
void odd(int);
void main()
{
int num;
clrscr();
printf("enter number");
scanf("%d",&num);
odd(num);
getch();
}
void odd(int num)
{
int i;
clrscr();
printf("od number upto the given numbers are");
for(i=1;i<=num;i++)
{
if(i%2!=0)
{
printf("%d\t",i);
}
}
Is This Answer Correct ? | 1 Yes | 2 No |
Post New Answer View All Answers
main use of recursive function a) processing speed high b) reduce program length/reduce repeated statements c) if you do not, use iterative methods like, for, while or do-while d) all the above
Write a program to show the change in position of a cursor using c
Is c is a procedural language?
Where static variables are stored in memory in c?
The postoder traversal is 7,14,3,55,22,5,17 Then ur Inorder traversal is??? please help me on this
Explain can the sizeof operator be used to tell the size of an array passed to a function?
Do string constants represent numerical values?
Explain how can a program be made to print the name of a source file where an error occurs?
What is structure in c explain with example?
Can a void pointer point to a function?
When reallocating memory if any other pointers point into the same piece of memory do you have to readjust these other pointers or do they get readjusted automatically?
Explain how can I manipulate strings of multibyte characters?
Write a program to print factorial of given number using recursion?
Why do we use int main?
i = 25;switch (i) {case 25: printf("The value is 25 ");case 30: printf("The value is 30 "); When the above statements are executed the output will be : a) The value is 25 b) The value is 30 c) The value is 25 The value is 30 d) none