write a program for odd numbers?
Answers were Sorted based on User's Feedback
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
what is a NULL pointer?
What is the use of #include in c?
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.
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.
#define MAX 3 main() { printf("MAX = %d ",MAX ); #undef MAX #ifdef MAX printf("Vector Institute”); #endif }
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?
increment operateor (++)and decrament(--) #include<stdio.h> #inclide<conio.h> main() { int x=15; while(x!=0) scanf("%d",&x); {
what is difference between getchar,putchar functions and printf and scanf function? does putchar show output only when input given to it
How would you find a cycle in a linked list?
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 ?
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.
Why is event driven programming or procedural programming, better within specific scenario?