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

1.write a program to merge the arrays 2.write efficient code for extracting unique elements from a sorted list of array?

3 Answers   Qualcomm,


how to add numbers without using arithmetic operators.

14 Answers   TCS,


how do we remove the printed character in printf statement and write next it it

1 Answers  


write C code to reverse a string such that if i/p is "abc defg hij klmno pqrs tuv wxyz" and the o/p should be "cba gfed jih onmlk srqp vut zyxw"

2 Answers  


GIVEN A FLOATING POINT NUMBER HOW IS IT ACTUALLY STORED IN MEMORY ? CAN ANYONE EXPLAIN?? THE 32 BIT REPRESENTATION OF A FLOATING POINT NUMBER ALLOTS: 1 BIT-SIGN 8 BITS-EXPONENT 23 BITS-MANTISSA

0 Answers  






Explain the difference between null pointer and void pointer.

0 Answers   TCS,


What is the time and space complexities of merge sort and when is it preferred over quick sort?

0 Answers   Amazon,


How to run c Program without using IDE of c. means if program made in notepad.then how to compile by command prompt.

1 Answers   HP, TCS,


Input is "rama loves rajesh and rajesh Loves rama also and rajesh wear gloves and bloves" To print output is count the numbers of times repeted the word love without case sensitive.

0 Answers  


What is the difference between printf and scanf )?

0 Answers  


Why array starts with index 0

2 Answers  


What is the purpose of ftell?

0 Answers  


Categories