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 that accepts 3 numbers from the user. dispaly the values in a descending order.
say the following declaration is correct nr not. int b=a,n=0;
Here is alphabets : abcdefgh 1) how to reverse. as hgfedcba 2) after reversal, how to group them in a pair hg fe dc ba.
Function which gives a pointer to a binary trees const an integer value at each code, return function of all the nodes in binary tree.?
main() { int i; printf("%d",scanf"%d",&i))//if the input is 12 24 34 then wat will be the output }
How can I read a directory in a C program?
2 Answers Bright Outdoor, Wipro,
Input any no. and print all the the numbers that comes before it like this for e.g input = 4 0 01 012 0123 01234 plz answer it 2day
main() { inta=10,b=20; a>=5?b=100:b=200; printf("%d ",b); }
What is the diffences between Windows XP and Windows Visa
Why cant I open a file by its explicit path?
what is the first address that gets stored in stack according to a C or C++ compiler???? or what will be the first address that gets stored when we write a C source code????????
a linearly ordered set of data elements that have the same structure and whose order is preserved in storage by using sequential allocation a) circular b) ordinary c) array d) linear list