In this lab we look at molecular formulae written out as follows:
H

WaltP commented: Nothing is URGENT here, as you would have known if you had bothered reading the Rules as requested. -2

Recommended Answers

All 3 Replies

Start by doing 1a which is very basic and quite simple. Then start adding the code for 1b. When you get stuck actually coding, we can help you overcome those problems. But you have to code something for us to help with.

yea but cld you provide some tips/pointers on how i even go abt startin it?from where do i start?

(sorry,im a beginner)

ok i got it..can someone help me check this code?

#include<stdio.h>

int main()
{
	char a[20];
	int count=0;
	int b=0;

	for(count=0;count<20;count++)
	{
		printf("\nPlease enter a character or '.' to stop:");
		scanf("%c", &a[count]);
		getchar();

		if (a[count]=='.')
		{
			break;
		}
	}
	while(count==20)
	{
		a[count]='.';
		break;
	}

	for(b=0;b<=count;b++)
	{
		printf("%c", a[b]);
	}


	return 0;
}
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.