Want this question answered?
The XOR operator is the carat character: ^Example:// Create characterchar ch = 'a';System.out.println(ch);// Perform XORch = (char)(ch ^ 86);System.out.println(ch);// Perform XOR...againch = (char)(ch ^ 86);System.out.println(ch);
#include<stdio.h> #include<string.h> void swap(char*,int); void gotoloop(char*,int); void main() { char *ch; int i,j,k,l; ch=(char*)malloc(20); //clrscr(); printf("Enter the string\n"); gets(ch); l=strlen(ch); gotoloop(ch,l); return; } void gotoloop(char *ch,int l) { int i,k; k=l; if(l<=1) return; for(i=0;i<k;i++) { swap(ch,k); l--; gotoloop(ch,l); l++; if(k==2) printf("\n%s ",ch); } } void swap(char *ch,int r) { char c; int i; c=ch[r-1]; for(i=r-1;i>0;i--) ch[i]=ch[i-1]; ch[0]=c; }
only Z
import java.io.*;class stack{char stack1[]=new char[20];int top;void push(char ch){top++;stack1[top]=ch;}char pop(){char ch;ch=stack1[top];top--;return ch;}int pre(char ch){switch(ch){case '-':return 1;case '+':return 1;case '*':return 2;case '/':return 2;}return 0;}boolean operator(char ch){if(ch=='/'ch=='*'ch=='+'ch=='-')return true;elsereturn false;}boolean isAlpha(char ch){if(ch>='a'&&ch='0'&&ch=='9')return true;elsereturn false;}void postfix(String str){char output[]=new char[str.length()];char ch;int p=0,i;for(i=0;ipre(stack1[top]))stack1[top]=='('){push(ch);}}else if(pre(ch)
The pronunciation of Chargoggagoggmanchauggagoggchaubunagungamaugg is: "char-GOG-a-GOG-man-CHOG-a-gog-cha-OH-bu-na-gung-a-mog."
class R { public static void main(String args[]) { String s="vikrant"; String s3=""; char ch[]=s.toCharArray(); char s1=ch[0]; char s2=ch[0]; for(int i=ch.length-2;i>=1;i--) s3+=ch[i]; System.out.println(s1+s3+s2); } } for more: kumar976001@gmail.com
class TestApp { public static void main(String args[]) { char ch; for( ch = 'a' ; ch <= 'z' ; ch++ ) System.out.println(ch); } }
#include <string.h> char * revsentence(char *str) { int i,j,len; char temp; len=0; len=strlen(str) for(i=0;j=len-1;i<j;i++,j--) { temp=str[i]; str[j]=str[i]; str[j]=temp; } return str; }
Consider an example in this we are just accepting a single character and printing it on the console. Example: { char ch; ch = getchar(); printf ('Accepted Character : %c', ch); }
Char, chat, chap, chip, chop...
this is the program ihave until now the problem is that it reverses the word itself also , if someone can help i will really appreciate it int main() { char forward_sentence[MAX]; char ch, terminator; int i = 0, j, len = 0; printf("Enter a sentence: "); ch = getchar(); while(i < MAX && ch != '\n' && ch != '.' && ch != '?' && ch != '!') { forward_sentence[i] = ch; i++; len++; ch = getchar(); } for(i = 0; i < MAX; i++) { if(ch ' ') { } printf("%c", forward_sentence[j]); } printf("%c", terminator); printf("\n"); return 0; }
variable declared with primitive datatype are called as primitive variable. ex: short s=12; char ch='a'; here in above case ch,s are declared with primitive datatype of short and char so it is called as primitive variables.. thanx, from rajesh adepu.