how can write all 1to 100 prime numbers using for loop,if and
break ?
Answers were Sorted based on User's Feedback
Answer / sandeep
#include<stdio.h>
main()
{
int a=2;
work:
printf("%d",a);
a=a+2;
check:
if(a<=100)
goto work;
}
Is This Answer Correct ? | 1 Yes | 0 No |
Answer / divyanshu
#include<iostream.h>
#incude<conio.h>
int main()
{
int x=100,i,p=1;
cout<<"enter the no.";
cin>>x;
for(i=2;i<x;i++)
{
if(x%i==0)
{
p=2;
break;
}
if(x==1)
{
cout<<"prime no.";
}
getch();
}
Is This Answer Correct ? | 2 Yes | 12 No |
Predict the output or error(s) for the following: 25. main() { printf("%p",main); }
what is meant by c
Bit swapping
hOW Can I add character in to pointer array of characters char *a="indian"; ie I want to add google after indian in the char *a
what are # pragma staments?
How can I copy just a portion of a string?
Program to find larger of the two numbers without using if-else,while,for,switch
write a program that explain #define and # undef directive
1. Write a C program to count the number of occurrence of a specific word in the given strings. (for e.g. Find how many times the word “live” comes in the sentence “Dream as if you’ll live forever, live as if you’ll die today ”)
What are the advantages and disadvantages of pointers?
What is the output of the following program main();{printf ("chennai""superkings"}; a. Chennai b. superkings c. error d. Chennai superkings
A function 'q' that accepts a pointer to a character as argument and returns a pointer to an array of integer can be declared as: A)int (*q(char*)) [] B)int *q(char*) [] C)int(*q)(char*) [] D)None of the Above