write a program for odd numbers?
Answers were Sorted based on User's Feedback
Answer / 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 |
Answer / monisha
#include<stdio.h>
#include<conio.h>
void main();
{
int n;
printf("Enter the number",n);
scanf("%d",&n);
for (i=1;i<=n;n+2)
printf("%d",i());
getch();
}
Is This Answer Correct ? | 0 Yes | 2 No |
Answer / nilaksh
#include<stdio.h>
#include<conio.h>
void main()
{
int i, n;
clrscr();
printf("\nHow many odd numbers?");
scanf("%d",&n);
for(i=1;i<=n*2;i++)
printf("\n %d",i);
getch();
}
Is This Answer Correct ? | 2 Yes | 6 No |
Answer / dally
#include<stdio.h>
int main()
{
int n,i;
printf("Enter values for n\n");
scanf("%d",&n);
for(i=0;i<=n;i++)
{
if(i%2 != 0)
printf("%d",i);
}
}
Is This Answer Correct ? | 10 Yes | 16 No |
Answer / sameer.chaudhari
main()
{
int num;
printf("Plz enter the number :=> ");
scanf("%d",&num);
if (num & 1)
printf("odd");
else
printf("even");
getch();
}
Is This Answer Correct ? | 22 Yes | 43 No |
write a program for fibonaci series by using while loop in c?
Is c a great language, or what?
What is dynamic dispatch in c++?
why effort estimation is important?
where does it flourished?
Can we declare variable anywhere in c?
What is the output for the program given below typedef enum grade{GOOD,BAD,WORST,}BAD; main() { BAD g1; g1=1; printf("%d",g1); }
can we access one file to one directory?
Describe the order of precedence with regards to operators in C.
How many bytes are occupied by near, far and huge pointers (dos)?
What does the function toupper() do?
What are static functions?