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
You are to write your own versions of strcpy() and strlen (). Call them mystrcpy() and mystrlen(). Write them first as code within main(), not as functions, then, convert them to functions. You will pass two arrays to the function in the case of mystrcpy(), the source and target array.
What is the full form of getch?
Write a program with dynamically allocation of variable.
What does the function toupper() do?
What is array of structure in c programming?
Explain what will the preprocessor do for a program?
When should volatile modifier be used?
Can a variable be both const and volatile?
What does printf does?
Differentiate between null and void pointers.
Which driver is a pure java driver
Difference between linking and loading?
What is difference between static and global variable in c?
Is multithreading possible in c?
How do you define structure?