Write a program to print prime nums from 1-20 using c
programing?
Answer Posted / r@m$
#include<stdio.h>
void main(){
int x;
for(x=2;x<=20;x++){
if(x<4)
printf("%d\t",x);
else
if(x%2!=0 && x%3!=0)
printf("%d\t",x);
}
}
Is This Answer Correct ? | 0 Yes | 1 No |
Post New Answer View All Answers
write a c program in such a way that if we enter the today date the output should be next day's date.
What is assert and when would I use it?
What is maximum size of array in c?
What is meant by int main ()?
Write a program to swap two numbers without using third variable?
What is the purpose of 'register' keyword in c language?
The purpose of this exercise is to benchmark file writing and reading speed. This exercise is divided into two parts. a). Write a file character by character such that the total file size becomes approximately >10K. After writing close the file handler, open a new stream and read the file character by character. Record both times. Execute this exercise at least 4 times b). Create a buffer capable of storing 100 characters. Now after generating the characters, first store them in the buffer. Once the buffer is filled up, store all the elements in the file. Repeat the process until the total file size becomes approximately >10K.While reading read a while line, store it in buffer and once buffer gets filled up, display the whole buffer. Repeat the exercise at least 4 times with different size of buffer (50, 100, 150 …). Records the times. c). Do an analysis of the differences in times and submit it in class.
What are global variables?
What is a function in c?
Function which gives a pointer to a binary trees const an integer value at each code, return function of all the nodes in binary tree.?
Define recursion in c.
Can the sizeof operator be used to tell the size of an array passed to a function?
What is a char c?
What does the file stdio.h contain?
Explain how can I convert a string to a number?