answersLogoWhite

0

its simple in c and c++: mainly it depends on what type of answer ur looking track fro the user .. if its a numeric u can define a integer or float variable else a string variable to store characters . ex : printf("\n whats ur age ?"); scanf("%d",&age); printf("\n hey ur %d years old :",age); cout

User Avatar

Wiki User

∙ 18y ago
User Avatar

What else can I help you with?

Related Questions

Write a c program using string concept enter a sting and replace the new string in to old string and find no of occurrence?

print c co com comp compu


How do you display a text reversely in C language without using onlu simply input and output?

#include<stdio.h> #include<conio.h> void main() { char string[20]; int i=0; printf("Enter the string.\n"); while(i<=19) { scanf("%c",&string[i]); i++; } while(i>=0) { printf("%c",string[i]); i--; } getch(); } In this program it is compulsory to enter 20 characters. Now we can write a program in which it is not necessary. #include<stdio.h> #include<conio.h> #include<string.h> void main() { char string[20]; int length; printf("enter the string.\n"); gets(string); length=strlen(string); length--; while(length>0) { printf("%c",string[length]); length--; } getch(); }


C program to concatenate two strings?

#include#includevoid main(){char a[30],b[30];clrscr();printf("Enter the string a:");gets(a);printf("Enter the string b:");gets(b);printf("%s",strcat(a,b));getch();}


What is the use of Reverse String in C program?

The use of the reverse string in C program is used to reverse the letters in the string. An example would be reverse me would be reversed to em esrever.


Program to find the size of the string in c?

int main (void) { char buf[1024]; scanf ("Enter a string: %s", buf); printf ("The length of the string is %d chars long.\n", strlen (buf)); return 0; }


Why and operator can not be used in string of c program?

Any character can be used in string, except for \\0. char example [] = "A&B|C";


Write a c plus plus program to read a line from keyboard?

#include <iostream> #include <string> int main() { std::string myStr = ""; std::cout << std::endl << "Enter a string: "; std::cin >> myStr; system("PAUSE"); return 0; }


C program plus copy of string to another?

strcpy


C plus plus program to perform string manipulation?

You do not need to program string manipulation as it is already part of the standard library. See std::string and std::wstring.


How do you enter a character on a specific place in string in c?

str[3]= 'A';


How do you write a c program to find a word in a string?

what is if(!(str[i]==32))


What type of a program is used in order to enter c source code?

What type of a program is used in order to enter C source code