print a semicolon using Cprogram without using a semicolon
any where in the C code in ur program!!
Answers were Sorted based on User's Feedback
Answer / sharath kumar
#include <stdio.h>
int main(void)
{
if (printf("%c ", 59))
{
}
return 0;
}
Is This Answer Correct ? | 0 Yes | 0 No |
Answer / ameya
Answer #1 and #2 are wrong. They dont work on Turbo C. If
anybody knows the write answer please email me the code.
Is This Answer Correct ? | 8 Yes | 9 No |
Answer / lakshmi
void main()
{
if(getche()){}
}
you can input ; at run time and itll be printed on output
screen.
Is This Answer Correct ? | 6 Yes | 7 No |
Answer / ceeemor
#include<iostream>
using namespace std;
int main() {
cout << char(59) << endl;
}
Is This Answer Correct ? | 2 Yes | 3 No |
Answer / subash
include<stdio.h>
include<conio.h>
void main()
{
if(printf(";"))
{
}
}
Because If statements executes the result atleast once whether
the condition is wrong.....Try and tell..It is working..I worked
Is This Answer Correct ? | 1 Yes | 2 No |
Answer / sorabh
#include<stdio.h>
#include<list>
#include<vector>
using namespace std;
char str[100002];
int dist[100002];
int n;
void BFS(int s)
{
vector<bool> visited(10,false);
list<int> queue;
dist[s] = 0;
queue.push_back(s);
while(!queue.empty())
{
s = queue.front();
queue.pop_front();
vector<int> temp; temp.clear();
if(s==0) temp.push_back(1);
else if(s==n-1) temp.push_back(n-2);
else { temp.push_back(s-1); temp.push_back(s+1);}
int sz=temp.size();
for(int i=0; i<sz; i++)
{
int node=temp[i];
if(1+dist[s]<dist[node]) {
dist[node] = 1+dist[s];
if(node==0) return;
queue.push_back(node);
}
}
if(!visited[str[s]-48]) {
sz=pos[str[s]-48].size();
for(int i=0; i<sz; i++)
{
int node=pos[str[s]-48][i];
if(1+dist[s]<dist[node]) {
dist[node] = 1+dist[s];
if(node==0) return;
queue.push_back(node);
}
}
visited[str[s]-48]=true;
}
}
}
int main()
{
scanf("%s",str);
n=strlen(str);
for(int i=0; i<n; i++) {
pos[str[i]-48].push_back(i);
dist[i] = INT_MAX;
}
BFS(n-1);
printf("%d",dist[0]);
return 0;
}
Is This Answer Correct ? | 0 Yes | 1 No |
Answer / vivek
#include<stdio.h>
void main()
{
if(printf("semicolon"))
{}
}
Is This Answer Correct ? | 0 Yes | 1 No |
Answer / poorna
#include<stdio.h>
void main()
{
while( printf("%c", 59), 0)
{
}
}
Is This Answer Correct ? | 2 Yes | 5 No |
1. const char *a; 2. char* const a; 3. char const *a; -Differentiate the above declarations.
Write a C program that defines a 2-dimentional integer array called A [50][50]. Then the elements of this array should randomly be initialized either to 1 or 0. The program should then print out all the elements in the diagonal (i.e. a[0][0], a[1][1],a[2][2], a[3][3], ……..a[49][49]). Finally, print out how many zeros and ones in the diagonal.
In the following pgm add a stmt in the function fun such that the address of 'a' gets stored in 'j'. main(){ int * j; void fun(int **); fun(&j); } void fun(int **k) { int a =0; /* add a stmt here*/ }
program to Reverse a linked list
12 Answers Aricent, Microsoft, Ness Technologies,
main() { printf("%d", out); } int out=100;
main() { char *p = “ayqm”; char c; c = ++*p++; printf(“%c”,c); }
print numbers till we want without using loops or condition statements like specifically(for,do while, while swiches, if etc)!
find A^B using Recursive function
Write a C function to search a number in the given list of numbers. donot use printf and scanf
char inputString[100] = {0}; To get string input from the keyboard which one of the following is better? 1) gets(inputString) 2) fgets(inputString, sizeof(inputString), fp)
C statement to copy a string without using loop and library function..
Write a program to model an exploding firecracker in the xy plane using a particle system