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 |
Why data types in all programming languages have some range? Why ritche have disigned first time likethat?Why not a single data type can support all other types?
What is static and volatile in c?
What is a void pointer? When is a void pointer used?
Every time i run a c-code in editor, getting some runtime error and editor is disposing, even after reinstalling the software what may be the problem?
What is Memory leakage ?
Reverse a string word by word??
What are the scope of static variables?
What is %d called in c?
What are the types of assignment statements?
What math functions are available for integers? For floating point?
What is substring in c?
What is local and global variable in c?