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

#define PRINT(int) printf("int = %d ",int) main() {< BR> intx,y,z; x=03;y=02;z=01; PRINT(x^x); z<<=3;PRINT(x); y>>=3;PRINT(y); }

0 Answers   Wilco,


any string of bits of length 'n' represents a unique non- negative integer between.............?

2 Answers  


Why c is called top down?

0 Answers  


main() { char *p; p="Hello"; printf("%c\n",*&*p); }

2 Answers   ME,


struct abc { unsigned int a; char b; float r; }; struct xyz { int u; struct abc tt; }ww; ww = (struct xyz*)malloc(sizeof(struct xyz)); will the memory be allocated for the inner structure also?

1 Answers   Wipro,






In which area global, external variables are stored?

3 Answers  


what is the different between if-else and switch statment (other than syntax)

26 Answers   CTS, Oracle, Scorpos,


write a program that will print %d in the output screen??

9 Answers   Infosys,


who did come first hen or agg

15 Answers   Infosys,


Is main is a keyword in c?

0 Answers  


Write a progarm to find the length of string using switch case?

0 Answers   TCS,


Reverse the part of the number which is present from position i to j. Print the new number. eg: num=789876 i=2 j=5 778986

1 Answers  


Categories