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
How is a macro different from a function?
How can I generate floating-point random numbers?
how to print electricity bill according to following charges first 100 units -1rs per unit for next 200 units-1.50 rs per unit without using conditions
What is 2 d array in c?
What is a constant?
Explain can the sizeof operator be used to tell the size of an array passed to a function?
what is event driven software and what is procedural driven software?
What's the total generic pointer type?
How can you restore a redirected standard stream?
What is #line?
Want to know how to write a C program that connects to a MySQL server and checks if the InnoDB plug-in is installed on it. If so, your program should print the total number of disk writes by MySQL.
What is a lvalue
What is static memory allocation? Explain
Explain the ternary tree?
What is the difference between far and near in c?