can we print any string in c language without using
semicolon(;)(terminator) in whole program.
Answers were Sorted based on User's Feedback
Answer / nitish_bhasin
#include<stdio.h>
void main()
{
if(printf("Hello")){}
}
Is This Answer Correct ? | 54 Yes | 11 No |
#include<stdio.h>
int main()
{
while(printf("Hai")&&0){}
}
Is This Answer Correct ? | 42 Yes | 15 No |
Answer / abhradeep chatterjee
#include<stdio.h>
void main()
{
if(printf("Hello")){}
}
this is the correct answer.
Is This Answer Correct ? | 22 Yes | 4 No |
Answer / gauravjeet singh gill
#include<stdio.h>
void main()
{
while(printf("hello")?0:1)
{
}
}
Is This Answer Correct ? | 20 Yes | 5 No |
Answer / geeta
#include<stdio.h>
void main()
{
if(printf("Hello World!!!")!=0)
{}
}
Is This Answer Correct ? | 11 Yes | 3 No |
Answer / k satish kumar reddy
main()
{
switch(printf("hello "))
{
}
}
Is This Answer Correct ? | 5 Yes | 1 No |
Answer / vinnu bhardwaj
main()
{
if(printf("Hello world"))
{}
}
//Here the {} act as a blank compound statement. But it is
//not mandatory to put some simple statements in it which
//require a semicolon. There are many more such answers to
//this question but the basic funda will be same
Is This Answer Correct ? | 5 Yes | 5 No |
Answer / taruna chaudhary
#include<stdio.h>
void main()
{
clrscr();
if("printf(hello pushpendra)")
getch();
}
Is This Answer Correct ? | 4 Yes | 5 No |
Answer / praveen vinny
/*
What if I want to print the sum of two numbers inside a
string without using a semicolon
*/
#include<iostream.h>
void main()
{
int a,b;
if(cout<<"Please enter two numbers : ")
if(cin>>a>>b)
if(cout<<"Sum = "<<(a+b))
}
Is This Answer Correct ? | 4 Yes | 5 No |
Answer / chandanakurukunda
#include<stdio.h>
void main()
{
if(printf("hello"))
{
}
}
Is This Answer Correct ? | 2 Yes | 4 No |
When I tried to go into a security sites I am denied access and a message appeared saying 'applet not initialize'. How can I rectify this problem.
You have given 2 array. You need to find whether they will create the same BST or not. For example: Array1:10 5 20 15 30 Array2:10 20 15 30 5 Result: True Array1:10 5 20 15 30 Array2:10 15 20 30 5 Result: False One Approach is Pretty Clear by creating BST O(nlogn) then checking two tree for identical O(N) overall O(nlogn) ..we need there exist O(N) Time & O(1) Space also without extra space .Algorithm ?? DevoCoder guest Posted 3 months ago # #define true 1 #define false 0 int check(int a1[],int a2[],int n1,int n2) { int i; //n1 size of array a1[] and n2 size of a2[] if(n1!=n2) return false; //n1 and n2 must be same for(i=0;i<n1-1;i++) { if( !( (a1[i]>a1[i+1]) && (a2[i]>a2[i+1]) ) ) return false; } return true;//assumed that each array doesn't contain duplicate elements in themshelves }
program to find the ASCII value of a number
Write a program to show the change in position of a cursor using c
What is that continue statement??
printf("%d",(printf("Hello")); What it returns?
9.how do you write a function that takes a variable number of arguments? What is the prototype of printf () function? 10.How do you access command-line arguments? 11.what does ‘#include<stdio.h>’ mean? 12.what is the difference between #include<> and #include”…”? 13.what are # pragma staments? 14.what is the most appropriate way to write a multi-statement macro?
#include<std.h> int main() { char *str[]={"Frogs","Do","Not","Die","They","Croak!"}; printf("%d %d\n",sizeof(str),strlen(str)); ...return 0; } what will the output of the above program?
What is the difference between constant pointer and constant variable?
Why should I use standard library functions instead of writing my own?
what is ram?
What is a far pointer in c?