write a program for odd numbers?

Answers were Sorted based on User's Feedback



write a program for odd numbers?..

Answer / chintu gandhi

main()
{
int i,n;
clrscr();
printf("\nenter range up to which u want to print");
scanf("%d",&n);
for(i=1;i<n;i=i+2)
{
printf("\n%d",i);
}
getch();
}

Is This Answer Correct ?    75 Yes 33 No

write a program for odd numbers?..

Answer / pratikjis@yahoo.com

#include "stdio.h"
#include "conio.h"

void main()
{
int i;
clrscr();
printf("Enter the number");
scanf("%d", &i);
if(i%2==0)
{
printf("the number is even %d", i);
}
else
{
printf("The number is odd %d", i);
}
getch();
}

Is This Answer Correct ?    36 Yes 19 No

write a program for odd numbers?..

Answer / narendra

#include<stdio.h>
#include<conio.h>
void main()
{
int num;
clrscr();
printf("enter ur range:");
scanf("%d",&num);
for(i=1;i<=num;i+2)
printf("%d",num);
getch();
}

Is This Answer Correct ?    27 Yes 19 No

write a program for odd numbers?..

Answer / keerthana

#include<stdio.h>
void main()
{
int n,i;
scanf("%d",&n);
for(i=0;i<=n;i++)
{
if(n%2)!=0)
printf("Odd numbers",n);
}
}

Is This Answer Correct ?    11 Yes 3 No

write a program for odd numbers?..

Answer / lakhan patidar

#include<stdio.h>
#include<conio.h>
void main()
{
int num;
clrscr();
printf("enter ur range:");
scanf("%d",&num);
for(i=1;i<=num;i+2)
printf("%d",num);
getch();
}

Is This Answer Correct ?    16 Yes 12 No

write a program for odd numbers?..

Answer / sreeshma

#include<stdio.h>
main()
{
int i,n;
printf("enter a range of numbers");
scanf("%d",&n);
for(i=0;i<=n;i+2)
{
printf("%d",i);
}
break;
getch();

Is This Answer Correct ?    9 Yes 5 No

write a program for odd numbers?..

Answer / aswani

#include<stdio.h>
#include<conio.h>
void main()
{
int a,b,c;
clrscr();
printf("enter the two numbers");
scanf("%d %d ",&a,&b);
c=a+b;
printf("%d sum is",c);
getch();
}

Is This Answer Correct ?    3 Yes 1 No

write a program for odd numbers?..

Answer / roopali

#include<stdio.h>
void main()
{
int i;
clrscr();
printf("\n odd numbers?");
scanf("%d",&n);
for(i=0;i<=n;i++)
print i=i+1;
printf("\n %d",i);
getch();
}

Is This Answer Correct ?    4 Yes 4 No

write a program for odd numbers?..

Answer / mahendiran

#include<stdio.h>
#include<conio.h>
void main()
{
int i;
clrscr();
printf("Enter the number");
scanf("%d", &i);
if(i%2==0)
{
printf("the number is even %d", i);
}
else
{
printf("The number is odd %d", i);
}
getch();
}

Is This Answer Correct ?    1 Yes 1 No

write a program for odd numbers?..

Answer / vivek singh

#include<stdio.h>
#include<conio.h>
void main()
{
int num;
printf("Enter the number:");
scanf("%d",&num);
if(num%2==0)
{
printf("Number is Even");
}
else
{
printf("Number is Odd");
}
getch();
}

Is This Answer Correct ?    1 Yes 1 No

Post New Answer

More C Interview Questions

what is a NULL pointer?

2 Answers  


What is the use of #include in c?

0 Answers  


1. Write a function to display the sum of two numbers in the following ways: By using (i) pass by value (ii) pass by address a. function with argument and with return value b. function with argument and without return value c. without argument , with return value d. without argument , without return value Note: Use pass by address.

0 Answers  


Read N characters in to an array . Use functions to do all problems and pass the address of array to function. 1. Print only the alphabets . If in upper case print in lower case vice versa.

1 Answers  


#define MAX 3 main() { printf("MAX = %d ",MAX ); #undef MAX #ifdef MAX printf("Vector Institute”); #endif }

1 Answers   Vector India,






Q.1 write aprogram to stack using linklist o insert 40 items? Q.2 write a program to implement circular queue with help of linklist?

0 Answers   TCS,


increment operateor (++)and decrament(--) #include<stdio.h> #inclide<conio.h> main() { int x=15; while(x!=0) scanf("%d",&x); {

2 Answers   HCL, Syntel, TCS,


what is difference between getchar,putchar functions and printf and scanf function? does putchar show output only when input given to it

5 Answers   DIT,


How would you find a cycle in a linked list?

3 Answers   NSN,


we have to use realloc only after malloc or calloc ? or we can use initially with out depending on whether we are using malloc or calloc in our program ?

2 Answers  


Write a program which has the following seven functions. The functions should be: • main() this calls the other 6 functions • fget_long() a function which returns a long data type from a file • fget_short() a function which returns a short integer variable from a file • fget_float() a function which returns a floating point variable from a file • fprt_long() a function which prints its single, long argument into a file • fprt_short() a function which prints its single, short argument into a file • fprt_float() a function which prints its single, floating point argument into a file. You should use fscanf() to get the values of the variables from the input (the file) and fprintf() to print the values to the other file. Pay attention to using the correct format for each of the data types.

0 Answers  


Why is event driven programming or procedural programming, better within specific scenario?

0 Answers   Wipro,


Categories