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 |
How can you access memory located at a certain address?
how to swap 4 number without using temporary number?
Explain Doubly Linked Lists?
int main(){ float f=8.0; if(f==8.0) printf("good"); else printf("bad"); } what is the answere and explain it?
write a c/c++ program that takes a 5 digit number and calculates 2 power that number and prints it?
Distinguish between actual and formal arguments.
write a c program to find largest number in matrix(in each row,each column, diagonally, and in the whole matrix)? Its urgent.
Why isn't any of this standardized in c? Any real program has to do some of these things.
what will the following program do? void main() { int i; char a[]="String"; char *p="New Sring"; char *Temp; Temp=a; a=malloc(strlen(p) + 1); strcpy(a,p); //Line no:9// p = malloc(strlen(Temp) + 1); strcpy(p,Temp); printf("(%s, %s)",a,p); free(p); free(a); } //Line no 15// a) Swap contents of p & a and print:(New string, string) b) Generate compilation error in line number 8 c) Generate compilation error in line number 5 d) Generate compilation error in line number 7 e) Generate compilation error in line number 1
what is the hardware model of CFG( context free grammar)
Explain what are linked list?
What is the difference between array and pointer in c?