adspace


Write a c code segment using a for loop that calculates and
prints the sum of the even integers from 2 to 30, inclusive?

Answer Posted / parekh nirav

#include<stdio.h>
#include<conio.h>
void main()
{
int i,no,sum=0;
clrscr();
printf("\n entre the no:-");
scanf("%d",&no);

for(i=2;i<=30;i+1)
{
printf("\n the list is %d",i);
sum=sum+i;
}
printf("\n the sum is %d",sum);
getch();
}

Is This Answer Correct ?    4 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

PLS U SENS ME INTERVIEW O. MY EMAIL ADD, SOFIYA.SINGH@GMAIL.COM

2267


write a c program to find the sum of five entered numbers using an array named number

2260


`write a program to display the recomended action depends on a color of trafic light using nested if statments

2218


What is the general form of a C program?

1107


What is the difference between union and anonymous union?

1412


What is pointers in c with example?

1173


Differentiate between null and void pointers.

1265


hi folks i m approching for h1 b interview on monday 8th of august at montreal and i m having little problem in my approval notice abt my bithdate my employer has made a mistake while applying it is 12th january and istead of that he had done 18 the of january do any body have any solution for that if yes how can i prove my visa officer abt my real birthdate it urgent please let me know guys thaks dipesh patel

1947


develop algorithms to add polynomials (i) in one variable

2267


write a progrmm in c language take user interface generate table using for loop?

2129


will u please send me the placement papers to my mail???????????????????

1936


What is variable initialization and why is it important?

1403


what is associativity explain what is the precidence for * and & , * and ++ how the folloing declaration work 1) *&p; 2) *p++;

2520


ATM machine and railway reservation class/object diagram

5342


What are compound statements?

1298