-2

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

Comments
Nothing is URGENT here, as you would have known if you had bothered reading the Rules as requested.
2
Contributors
3
Replies
4
Views
7 Years
Discussion Span
Last Post by bliya123
0

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.

0

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)

0

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;
}

Edited by bliya123: n/a

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.