Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


To generate the series 1+3+5+7+... using C program

Answers were Sorted based on User's Feedback



To generate the series 1+3+5+7+... using C program..

Answer / shiva

for(int a=0;a<10;a++){
(a&1)?printf("%d\n",a):printf("\n");
}

Is This Answer Correct ?    8 Yes 6 No

To generate the series 1+3+5+7+... using C program..

Answer / nasif

#include<stdio.h>
int main()
{
int n,i,d=1,sum=0;
scanf("%d", &n);
for(i=1;i<=n;d=d+2){
sum=sum+d;
i++;
}
printf("summation is %d", sum);
return 0;
}

Is This Answer Correct ?    1 Yes 0 No

To generate the series 1+3+5+7+... using C program..

Answer / meheka

#inclined <stdio.h>
int main ()
{
int I=1,n,sum=0;
scanf("%d",&n);
while(i<=n)
sum=sum+I;
{
printf("%d",sum);
I=I+2;
}
return 0:

Is This Answer Correct ?    1 Yes 0 No

To generate the series 1+3+5+7+... using C program..

Answer / beetha poulose

#include<include>
int main ()
{
int j,i,n,sum=0;
Print("enter n");
scanf ("%d",&n);
For (i=1,j=1; j<=n; i=i+5,j++)
{
Sum=sum +i;
}
Prinrf ("sym=%d",sum);
Return 0;
}

Is This Answer Correct ?    1 Yes 0 No

To generate the series 1+3+5+7+... using C program..

Answer / nishant

#include<stdio.h>
#include<conio.h>
void main()
{
int n,i=1,sum=0;
clrscr();
printf("enter the value for n:");
scanf("%d",&n);
while(i<=n)
{
sum=sum+i;
i=i+2;
}
printf("the series is =%d");
getch()
}

Is This Answer Correct ?    0 Yes 0 No

To generate the series 1+3+5+7+... using C program..

Answer / aditya parashar

#include<iostream.h>
void main ()
{int s,n;
cout <<"For finding sum of series
1+3+5.. till n terms enter value of n: ";
cin>>n;
s=n*n;
cout<<"
sum of series 1+3+5+.. till n
terms is: "<<s;
}
[Note:- only output matters]

Is This Answer Correct ?    0 Yes 0 No

To generate the series 1+3+5+7+... using C program..

Answer / medo

//*I know this is a different program but i want you to try
it!*//



#include <stdio.h>
void main()
{
int i,j;

for(i=1;i<=4;i++)
{
for(j=1;j<=8;j++)
{printf("* ");}
printf("\n");

for(j=1;j<=8;j++)
{printf(" *"); }
printf("\n");
}
}

Is This Answer Correct ?    7 Yes 8 No

To generate the series 1+3+5+7+... using C program..

Answer / parthibanselvaraj

the series seems to be infinite . so you need to restrict
it to some ceiling.

Is This Answer Correct ?    10 Yes 19 No

Post New Answer

More C C++ Errors Interview Questions

I'm having trouble with coming up with the correct code. Do I need to put a loop? Please let me know if I'm on the right track and what areas I need to correct. I still don't have a good grasp on this programming stuff. Thanks =) The assignment was to write a program using string functions that accepts a coded value of an item and displays its equivalent tag price. The base of the keys: 0 1 2 3 4 5 6 7 8 9 X C O M P U T E R S Sample I/O Dialogue: Enter coded value: TR.XX Tag Price : 68.00

3 Answers   UCB,


#include"stdio.h" #include"conio.h" void main() { int a; printf("\n enter a number:"); scanf("%c\n"); getch(); }

12 Answers   HCL,


difference between c/c++ programing language? what is necessesity of c++ when existing c programing language?

2 Answers   TCS,


Write a program to accept two strings of Odd lengths. Then take all odd characters from one string and even characters from the other and concatenate and produce a string.

1 Answers  


void main() { int i=5,y=3,z=2,ans; clrscr(); printf("%d",++i + --z + i++ + --i * ++y); i=5,y=3,z=2; ans=++i + --z + i++ + --i * ++y; printf("\n%d",ans); getch(); } Its output is 37 and 31.... Please explain me why its different How it works.....

2 Answers  


what is syntax error?

3 Answers  


what is run time error?

7 Answers  


void main() { for(int i=0;i<5;i++); printf("%d",i); } What is the output?..

32 Answers   College School Exams Tests, CTS, HCL, iGate, SmartData,


which typw of errors ? & how to solve it ?

0 Answers  


How to develop a program using C language to convert 8-bit binary values to decimals. TQ

1 Answers   Amazon,


what is meant by linking error? how can i solve it? if there is a linking error " unable to open file 'cos.obj'? then what should i do?

1 Answers  


WHAT WILL BE THE OUTPUT OF THE FOLLOWING QUESTION void main() { int x=4,y=3,z; z=x-- -y; printf("%d%d%d",x,y,z); }

25 Answers   HCL,


Categories