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 |
What does struct node * mean?
How can I ensure that integer arithmetic doesnt overflow?
how to add two numbers without using arithmetic operators?
WRITE A PROGRAM IN C TO MULTIPLY TWO 2-D ARRAYS
What is static memory allocation?
tell me the full form of c?
Why c is called object oriented language?
Study the code: void show() main() { show(); } void show (char *s) { printf("%sn",s); } What will happen if it is compiled & run on an ANSI C Compiler? A)It will compile & nothing will be printed when it is executed B)it will compile but not link C)the compiler will generate an error D)the compiler will generate a warning
How do you override a defined macro?
Which header file should you include if you are to develop a function which can accept variable number of arguments?
write a function for strtok()??
how to write palindrome program?