Using string functions write a program that will accept the
name of the capital as input value and will display the
corresponding country.
------------------------
Capitals Countries
------------------------
Capitals Countries
Ottawa Canada
Moscow Russia
Rome Italy
I can't not get it to run properly
Answer / roxy
this is my code:
#include<stdio.h>
#include<string.h>
main()
{
char cc1[]={"OTTAWA"},
{"MOSCOW"},
{"ROME"};
char cc2[]={"CANADA"}
{"RUSSIA"}
{"ITALY"};
char a;
clrscr();
printf("Enter Capital: ");
scanf("%s",&cc1);
a=strcmpi(cc1,cc2);
strncpy(cc2,cc1,[1]);
if(a==0)
{
printf("\nThe capital of %s is %s",cc1,cc2);
}
if(a==1)
{
printf("\nThe capital of %s is %s",cc1,cc2);
}
else(a==2)
printf("\nThe capital of %s is %s",cc1,cc2);
getch()
}
| Is This Answer Correct ? | 13 Yes | 84 No |
who was the present cheif governor of reserve bank of india
6 Answers State Bank Of India SBI,
#include<>stdio.h> #include<>conio.h> { printf("hello"); void main() getch(); } what the out put of this program and why ......plz clear my answer
How to develop a program using C language to convert 8-bit binary values to decimals. TQ
Given that two int variables, total and amount , have been declared, write a sequence of statements that: initializes total to 0 reads three values into amount , one at a time. After each value is read in to amount , it is added to the value in total (that is, total is incremented by the value in amount ). Instructor's notes: If you use a loop, it must be a for loop. And if you use a loop control variable for counting, you must declare it.
I am using Qt 5.6 during compilation it stops and gives error about Qmake The process "C:QtQt5.6.35.6.3msvc2015_64inqmake.exe" crashed. Error while building/deploying project untitled1 (kit: Desktop Qt 5.6.3 MSVC2015 64bit) When executing step "qmake"
A sample program using data structure? what is file handling?
quoroum of computer languages?
How to create a program that lists the capital country when told what the original country is? (Terribly sorry, I'm a novice programmer and would appreciate any help ;). Cheers, Alexxis
To generate the series 1+3+5+7+... using C program
void main() { int i=5,y=3,z=2,ans; clrscr(); printf("%d",++i + --z + i++ + --i * ++y); i=5,y=3,z=2; ans=++i + --z + i++ + --i * ++y; printf("\n%d",ans); getch(); } Its output is 37 and 31.... Please explain me why its different How it works.....
UINT i,j; i = j = 0; i = ( i++ > ++j ) ? i++ : i--; explain pls....
Given an int variable n that has been initialized to a positive value and, in addition, int variables k and total that have already been declared, use a do...while loop to compute the sum of the cubes of the first n whole numbers, and store this value in total . Thus if n equals 4, your code should put 1*1*1 + 2*2*2 + 3*3*3 + 4*4*4 into total . Use no variables other than n , k , and total .